001: /* *************************************************************************
002:
003: Millstone(TM)
004: Open Sourced User Interface Library for
005: Internet Development with Java
006:
007: Millstone is a registered trademark of IT Mill Ltd
008: Copyright (C) 2000-2005 IT Mill Ltd
009:
010: *************************************************************************
011:
012: This library is free software; you can redistribute it and/or
013: modify it under the terms of the GNU Lesser General Public
014: license version 2.1 as published by the Free Software Foundation.
015:
016: This library is distributed in the hope that it will be useful,
017: but WITHOUT ANY WARRANTY; without even the implied warranty of
018: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
019: Lesser General Public License for more details.
020:
021: You should have received a copy of the GNU Lesser General Public
022: License along with this library; if not, write to the Free Software
023: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
024:
025: *************************************************************************
026:
027: For more information, contact:
028:
029: IT Mill Ltd phone: +358 2 4802 7180
030: Ruukinkatu 2-4 fax: +358 2 4802 7181
031: 20540, Turku email: info@itmill.com
032: Finland company www: www.itmill.com
033:
034: Primary source for MillStone information and releases: www.millstone.org
035:
036: ********************************************************************** */
037:
038: package org.millstone.base.terminal;
039:
040: /** Interface to be implemented by components wishing to
041: * display some object that may be dynamically
042: * resized during runtime.
043: *
044: * @author IT Mill Ltd.
045: * @version 3.1.1
046: * @since 3.0
047: */
048: public interface Sizeable {
049:
050: /** Unit code representing pixels. */
051: public static final int UNITS_PIXELS = 0;
052:
053: /** Unit code representing points (1/72nd of an inch). */
054: public static final int UNITS_POINTS = 1;
055:
056: /** Unit code representing picas (12 points). */
057: public static final int UNITS_PICAS = 2;
058:
059: /** Unit code representing the font-size of the relevant font. */
060: public static final int UNITS_EM = 3;
061:
062: /** Unit code representing the x-height of the relevant font. */
063: public static final int UNITS_EX = 4;
064:
065: /** Unit code representing millimetres. */
066: public static final int UNITS_MM = 5;
067:
068: /** Unit code representing centimetres. */
069: public static final int UNITS_CM = 6;
070:
071: /** Unit code representing inches. */
072: public static final int UNITS_INCH = 7;
073:
074: /** Unit code representing in percentage of the containing element
075: * defined by terminal.
076: */
077: public static final int UNITS_PERCENTAGE = 8;
078:
079: /** Textual representations of units symbols.
080: * Supported units and their symbols are:
081: * <ul>
082: * <li><code>UNITS_PIXELS</code>: "" (unit is omitted for pixels)</li>
083: * <li><code>UNITS_POINTS</code>: "pt"</li>
084: * <li><code>UNITS_PICAS</code>: "pc"</li>
085: * <li><code>UNITS_EM</code>: "em"</li>
086: * <li><code>UNITS_EX</code>: "ex"</li>
087: * <li><code>UNITS_MM</code>: "mm"</li>
088: * <li><code>UNITS_CM</code>. "cm"</li>
089: * <li><code>UNITS_INCH</code>: "in"</li>
090: * <li><code>UNITS_PERCENTAGE</code>: "%"</li>
091: * </ul>
092: * These can be used like <code>Sizeable.UNIT_SYMBOLS[UNITS_PIXELS]</code>.
093: */
094: public static final String[] UNIT_SYMBOLS = { "", "pt", "pc", "em",
095: "ex", "mm", "cm", "in", "%" };
096:
097: /** Get width of the object. Negative number implies unspecified size
098: * (terminal is free to set the size).
099: * @return width of the object in units specified by widthUnits property.
100: */
101: public int getWidth();
102:
103: /** Set width of the object. Negative number implies unspecified size
104: * (terminal is free to set the size).
105: * @param width width of the object in units specified by widthUnits property.
106: */
107: public void setWidth(int width);
108:
109: /** Get height of the object. Negative number implies unspecified size
110: * (terminal is free to set the size).
111: * @return height of the object in units specified by heightUnits property.
112: */
113: public int getHeight();
114:
115: /** Set height of the object. Negative number implies unspecified size
116: * (terminal is free to set the size).
117: * @param height height of the object in units specified by heightUnits property.
118: */
119: public void setHeight(int height);
120:
121: /** Get width property units.
122: * @return units used in width property.
123: */
124: public int getWidthUnits();
125:
126: /** Set width property units.
127: * @param units units used in width property.
128: */
129: public void setWidthUnits(int units);
130:
131: /** Get height property units.
132: * @return units used in height property.
133: */
134: public int getHeightUnits();
135:
136: /** Set height property units.
137: * @param units units used in height property.
138: */
139: public void setHeightUnits(int units);
140:
141: }
|