001: /*
002: * Copyright (c) 2005-2008 Substance Kirill Grouchnikov. All Rights Reserved.
003: *
004: * Redistribution and use in source and binary forms, with or without
005: * modification, are permitted provided that the following conditions are met:
006: *
007: * o Redistributions of source code must retain the above copyright notice,
008: * this list of conditions and the following disclaimer.
009: *
010: * o Redistributions in binary form must reproduce the above copyright notice,
011: * this list of conditions and the following disclaimer in the documentation
012: * and/or other materials provided with the distribution.
013: *
014: * o Neither the name of Substance Kirill Grouchnikov nor the names of
015: * its contributors may be used to endorse or promote products derived
016: * from this software without specific prior written permission.
017: *
018: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
019: * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
020: * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
021: * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
022: * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
023: * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
024: * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
025: * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
026: * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
027: * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
028: * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
029: */
030: package org.jvnet.substance.button;
031:
032: import java.awt.Dimension;
033: import java.awt.Insets;
034: import java.awt.geom.GeneralPath;
035:
036: import javax.swing.AbstractButton;
037: import javax.swing.border.Border;
038:
039: import org.jvnet.substance.utils.SubstanceTrait;
040:
041: /**
042: * Button shaper interface for <b>Substance</b> look and feel. This class is
043: * part of officially supported API.
044: *
045: * @author Kirill Grouchnikov
046: */
047: public interface SubstanceButtonShaper extends SubstanceTrait {
048: /*
049: * (non-Javadoc)
050: *
051: * @see org.jvnet.substance.utils.SubstanceTrait#getDisplayName()
052: */
053: public String getDisplayName();
054:
055: /**
056: * Returns the outline path for the specified button.
057: *
058: * @param button
059: * A button.
060: * @return The outline path for the specified button.
061: */
062: public GeneralPath getButtonOutline(AbstractButton button);
063:
064: /**
065: * Returns the outline path for the specified button.
066: *
067: * @param button
068: * A button.
069: * @param insets
070: * Button insets.
071: * @param width
072: * Button width.
073: * @param height
074: * Button height.
075: * @return The outline path for the specified button.
076: */
077: public GeneralPath getButtonOutline(AbstractButton button,
078: Insets insets, int width, int height);
079:
080: /**
081: * Returns the outline path for the specified button.
082: *
083: * @param button
084: * A button.
085: * @param insets
086: * Button insets.
087: * @return The outline path for the specified button.
088: */
089: public GeneralPath getButtonOutline(AbstractButton button,
090: Insets insets);
091:
092: /**
093: * Returns the border for the specified button.
094: *
095: * @param button
096: * A button.
097: * @return The border for the specified button.
098: */
099: public Border getButtonBorder(AbstractButton button);
100:
101: /**
102: * Returns the preferred size for the specified button.
103: *
104: * @param button
105: * A button.
106: * @param uiPreferredSize
107: * Preferred size of the button under the regular conditions
108: * (plain rectangular button).
109: * @return The preferred size for the specified button.
110: */
111: public Dimension getPreferredSize(AbstractButton button,
112: Dimension uiPreferredSize);
113:
114: /**
115: * Returns the boolean indication whether the shaper should maintain button
116: * proportions on the resize. This may be relevant for vector-based shapers
117: * (such as animals / other objects).
118: *
119: * @return <code>true</code> if <code>this</code> shaper should maintain
120: * button proportions on the resize, <code>false</code> otherwise.
121: *
122: */
123: public boolean isProportionate();
124: }
|