001: /*
002: * Copyright 2000,2005 wingS development team.
003: *
004: * This file is part of wingS (http://wingsframework.org).
005: *
006: * wingS is free software; you can redistribute it and/or modify
007: * it under the terms of the GNU Lesser General Public License
008: * as published by the Free Software Foundation; either version 2.1
009: * of the License, or (at your option) any later version.
010: *
011: * Please see COPYING for the complete licence.
012: */
013: package org.wings.border;
014:
015: import org.wings.SComponent;
016: import org.wings.style.CSSAttributeSet;
017:
018: import java.awt.*;
019: import java.io.Serializable;
020: import org.wings.plaf.css.BorderCG;
021:
022: /**
023: * This is the interface for Borders.
024: *
025: * @author <a href="mailto:haaf@mercatis.de">Armin Haaf</a>
026: */
027: public interface SBorder extends Serializable, Cloneable {
028: /**
029: * Sets the insets of this border. Insets describe the amount
030: * of space 'around' the bordered component.
031: *
032: * @see #getInsets()
033: */
034: void setInsets(Insets insets);
035:
036: /**
037: * Returns the insets of this border.
038: *
039: * @return Insets specification of the border.
040: * @see #setInsets
041: */
042: Insets getInsets();
043:
044: /**
045: * Get the color of the border.
046: *
047: * @return color
048: */
049: Color getColor();
050:
051: /**
052: * Get the color of this border.
053: *
054: * @param color the color
055: */
056: void setColor(Color color);
057:
058: /**
059: * Get the thickness in pixel for this border.
060: *
061: * @return thickness
062: * @see #setThickness(int)
063: */
064: int getThickness();
065:
066: /**
067: * Set the thickness in pixel for this border.
068: *
069: * @see #getThickness()
070: */
071: void setThickness(int thickness);
072:
073: /**
074: * @return The CSS Attributes which need to be applied to the component to build up the border.
075: */
076: CSSAttributeSet getAttributes();
077:
078: /**
079: * @param component The component owning this border
080: */
081: void setComponent(SComponent component);
082:
083: /**
084: * Get the color of the border for one of SConstants.TOP, SConstants.LEFT, SConstants.RIGHT or SConstants.BOTTOM.
085: * @param position SConstants.TOP, SConstants.LEFT, SConstants.RIGHT or SConstants.BOTTOM
086: * @return the color
087: */
088: Color getColor(int position);
089:
090: /**
091: * Set the color of the border for one of SConstants.TOP, SConstants.LEFT, SConstants.RIGHT or SConstants.BOTTOM.
092: * @param position SConstants.TOP, SConstants.LEFT, SConstants.RIGHT or SConstants.BOTTOM
093: * @param color the color
094: */
095: void setColor(Color color, int position);
096:
097: /**
098: * Set the thickness of the border for one of SConstants.TOP, SConstants.LEFT, SConstants.RIGHT or SConstants.BOTTOM.
099: * @param position SConstants.TOP, SConstants.LEFT, SConstants.RIGHT or SConstants.BOTTOM
100: * @param thickness the thickness
101: */
102: void setThickness(int thickness, int position);
103:
104: /**
105: * Get the thickness of the border for one of SConstants.TOP, SConstants.LEFT, SConstants.RIGHT or SConstants.BOTTOM.
106: * @param position SConstants.TOP, SConstants.LEFT, SConstants.RIGHT or SConstants.BOTTOM
107: * @return the thickness
108: */
109: int getThickness(int position);
110:
111: /**
112: * Set the style of the border for one of SConstants.TOP, SConstants.LEFT, SConstants.RIGHT or SConstants.BOTTOM.
113: * @param position SConstants.TOP, SConstants.LEFT, SConstants.RIGHT or SConstants.BOTTOM
114: * @param style the style
115: */
116: void setStyle(String style, int position);
117:
118: /**
119: * Get the style of the border for one of SConstants.TOP, SConstants.LEFT, SConstants.RIGHT or SConstants.BOTTOM.
120: * @param position SConstants.TOP, SConstants.LEFT, SConstants.RIGHT or SConstants.BOTTOM
121: * @return the style
122: */
123: String getStyle(int position);
124:
125: BorderCG getCG();
126: }
|