View Javadoc

1   package fr.ove.openmath.jome.ctrlview.bidim.images;
2   
3   import fr.ove.utils.CachingResourcesManager;
4   
5   /***
6   * The resources manager for the images.<BR>
7   * The syntax for the resources is : imgId = imgName:heightFactor:baseline
8   * (Look at the resources file to get full signification of the different fields)
9   *
10  * @author © 2000 DIRAT Laurent
11  * @version 2.0  04/01/2000
12  */
13  public class ImagesResourcesManager extends CachingResourcesManager {
14      /***
15      * The Constructor.
16      * @param resourcesName the name of the resources file.
17      */
18      public ImagesResourcesManager(String resourcesName) {
19          super(resourcesName);
20      }
21      
22      /***
23      * Returns the name of the image corresponding to the property
24      * @param property the specified property
25      */
26      public String getImageName(String property) {
27          return accessResource(property, 0);
28      }    
29      
30      /***
31      * Returns the height factor to apply to the orignal size of the image corresponding to the property
32      * @param property the specified property
33      */
34      public String getHeightFactor(String property) {
35          String heightFactor = accessResource(property, 1);
36          if ((heightFactor != null) && heightFactor.equals("null"))
37              heightFactor = null;
38              
39          return heightFactor;
40      }    
41      
42      /***
43      * Returns the baseline of the image corresponding to the property
44      * @param property the specified property
45      */
46      public String getBaseline(String property) {
47          String baseline = accessResource(property, 2);
48          if ((baseline != null) && baseline.equals("null"))
49              baseline = null;
50              
51          return baseline;
52      }
53      
54      /***
55      * Returns the top inset of the image corresponding to the property
56      * @param property the specified property
57      */
58      public String getTopInset(String property) {
59          String inset = accessResource(property, 3);
60          if ((inset != null) && inset.equals("null"))
61              inset = null;
62              
63          return inset;
64      }
65      
66      /***
67      * Returns the bottom inset of the image corresponding to the property
68      * @param property the specified property
69      */
70      public String getBottomInset(String property) {
71          String inset = accessResource(property, 4);
72          if ((inset != null) && inset.equals("null"))
73              inset = null;
74              
75          return inset;
76      }
77      
78      /***
79      * Returns the left inset of the image corresponding to the property
80      * @param property the specified property
81      */
82      public String getLeftInset(String property) {
83          String inset = accessResource(property, 5);
84          if ((inset != null) && inset.equals("null"))
85              inset = null;
86              
87          return inset;
88      }
89      
90      /***
91      * Returns the right inset of the image corresponding to the property
92      * @param property the specified property
93      */
94      public String getRightInset(String property) {
95          String inset = accessResource(property, 6);
96          if ((inset != null) && inset.equals("null"))
97              inset = null;
98              
99          return inset;
100     }
101 }