下面列出了怎么用javax.swing.plaf.synth.SynthConstants的API类实例代码及写法,或者点击链接到github查看源代码。
private static void validate() throws Exception {
Method getSelectedUIMethod = SynthLookAndFeel.class.getDeclaredMethod("getSelectedUI");
getSelectedUIMethod.setAccessible(true);
Method getSelectedUIStateMethod = SynthLookAndFeel.class.getDeclaredMethod("getSelectedUIState");
getSelectedUIStateMethod.setAccessible(true);
if (getSelectedUIMethod.invoke(null) != componentUI) {
throw new RuntimeException("getSelectedUI returns invalid value");
}
if (((Integer) getSelectedUIStateMethod.invoke(null)).intValue() !=
(SynthConstants.SELECTED | SynthConstants.FOCUSED)) {
throw new RuntimeException("getSelectedUIState returns invalid value");
}
}
private static void validate() throws Exception {
Method getSelectedUIMethod = SynthLookAndFeel.class.getDeclaredMethod("getSelectedUI");
getSelectedUIMethod.setAccessible(true);
Method getSelectedUIStateMethod = SynthLookAndFeel.class.getDeclaredMethod("getSelectedUIState");
getSelectedUIStateMethod.setAccessible(true);
if (getSelectedUIMethod.invoke(null) != componentUI) {
throw new RuntimeException("getSelectedUI returns invalid value");
}
if (((Integer) getSelectedUIStateMethod.invoke(null)).intValue() !=
(SynthConstants.SELECTED | SynthConstants.FOCUSED)) {
throw new RuntimeException("getSelectedUIState returns invalid value");
}
}
private static void validate() throws Exception {
Method getSelectedUIMethod = SynthLookAndFeel.class.getDeclaredMethod("getSelectedUI");
getSelectedUIMethod.setAccessible(true);
Method getSelectedUIStateMethod = SynthLookAndFeel.class.getDeclaredMethod("getSelectedUIState");
getSelectedUIStateMethod.setAccessible(true);
if (getSelectedUIMethod.invoke(null) != componentUI) {
throw new RuntimeException("getSelectedUI returns invalid value");
}
if (((Integer) getSelectedUIStateMethod.invoke(null)).intValue() !=
(SynthConstants.SELECTED | SynthConstants.FOCUSED)) {
throw new RuntimeException("getSelectedUIState returns invalid value");
}
}
private static void validate() throws Exception {
Method getSelectedUIMethod = SynthLookAndFeel.class.getDeclaredMethod("getSelectedUI");
getSelectedUIMethod.setAccessible(true);
Method getSelectedUIStateMethod = SynthLookAndFeel.class.getDeclaredMethod("getSelectedUIState");
getSelectedUIStateMethod.setAccessible(true);
if (getSelectedUIMethod.invoke(null) != componentUI) {
throw new RuntimeException("getSelectedUI returns invalid value");
}
if (((Integer) getSelectedUIStateMethod.invoke(null)).intValue() !=
(SynthConstants.SELECTED | SynthConstants.FOCUSED)) {
throw new RuntimeException("getSelectedUIState returns invalid value");
}
}
public void paintInterior(Graphics g, Component c) {
GtkEditorTabCellRenderer ren = (GtkEditorTabCellRenderer) c;
Polygon p = getInteriorPolygon(c);
int state = ren.isSelected() ? ren.isActive() ? SynthConstants.FOCUSED
: SynthConstants.SELECTED : SynthConstants.DEFAULT;
Rectangle bounds = p.getBounds();
int yDiff = getHeightDifference(ren);
paintTabBackground(g, 0, state, bounds.x, bounds.y + yDiff,
bounds.width, bounds.height - yDiff);
if (!supportsCloseButton((JComponent)c)) {
return;
}
paintCloseButton( g, (JComponent)c );
}
private static void validate() throws Exception {
Method getSelectedUIMethod = SynthLookAndFeel.class.getDeclaredMethod("getSelectedUI");
getSelectedUIMethod.setAccessible(true);
Method getSelectedUIStateMethod = SynthLookAndFeel.class.getDeclaredMethod("getSelectedUIState");
getSelectedUIStateMethod.setAccessible(true);
if (getSelectedUIMethod.invoke(null) != componentUI) {
throw new RuntimeException("getSelectedUI returns invalid value");
}
if (((Integer) getSelectedUIStateMethod.invoke(null)).intValue() !=
(SynthConstants.SELECTED | SynthConstants.FOCUSED)) {
throw new RuntimeException("getSelectedUIState returns invalid value");
}
}
private static void validate() throws Exception {
Method getSelectedUIMethod = SynthLookAndFeel.class.getDeclaredMethod("getSelectedUI");
getSelectedUIMethod.setAccessible(true);
Method getSelectedUIStateMethod = SynthLookAndFeel.class.getDeclaredMethod("getSelectedUIState");
getSelectedUIStateMethod.setAccessible(true);
if (getSelectedUIMethod.invoke(null) != componentUI) {
throw new RuntimeException("getSelectedUI returns invalid value");
}
if (((Integer) getSelectedUIStateMethod.invoke(null)).intValue() !=
(SynthConstants.SELECTED | SynthConstants.FOCUSED)) {
throw new RuntimeException("getSelectedUIState returns invalid value");
}
}
private static void validate() throws Exception {
Method getSelectedUIMethod = SynthLookAndFeel.class.getDeclaredMethod("getSelectedUI");
getSelectedUIMethod.setAccessible(true);
Method getSelectedUIStateMethod = SynthLookAndFeel.class.getDeclaredMethod("getSelectedUIState");
getSelectedUIStateMethod.setAccessible(true);
if (getSelectedUIMethod.invoke(null) != componentUI) {
throw new RuntimeException("getSelectedUI returns invalid value");
}
if (((Integer) getSelectedUIStateMethod.invoke(null)).intValue() !=
(SynthConstants.SELECTED | SynthConstants.FOCUSED)) {
throw new RuntimeException("getSelectedUIState returns invalid value");
}
}
private static void validate() throws Exception {
Method getSelectedUIMethod = SynthLookAndFeel.class.getDeclaredMethod("getSelectedUI");
getSelectedUIMethod.setAccessible(true);
Method getSelectedUIStateMethod = SynthLookAndFeel.class.getDeclaredMethod("getSelectedUIState");
getSelectedUIStateMethod.setAccessible(true);
if (getSelectedUIMethod.invoke(null) != componentUI) {
throw new RuntimeException("getSelectedUI returns invalid value");
}
if (((Integer) getSelectedUIStateMethod.invoke(null)).intValue() !=
(SynthConstants.SELECTED | SynthConstants.FOCUSED)) {
throw new RuntimeException("getSelectedUIState returns invalid value");
}
}
private static void validate() throws Exception {
Method getSelectedUIMethod = SynthLookAndFeel.class.getDeclaredMethod("getSelectedUI");
getSelectedUIMethod.setAccessible(true);
Method getSelectedUIStateMethod = SynthLookAndFeel.class.getDeclaredMethod("getSelectedUIState");
getSelectedUIStateMethod.setAccessible(true);
if (getSelectedUIMethod.invoke(null) != componentUI) {
throw new RuntimeException("getSelectedUI returns invalid value");
}
if (((Integer) getSelectedUIStateMethod.invoke(null)).intValue() !=
(SynthConstants.SELECTED | SynthConstants.FOCUSED)) {
throw new RuntimeException("getSelectedUIState returns invalid value");
}
}
private static void validate() throws Exception {
Method getSelectedUIMethod = SynthLookAndFeel.class.getDeclaredMethod("getSelectedUI");
getSelectedUIMethod.setAccessible(true);
Method getSelectedUIStateMethod = SynthLookAndFeel.class.getDeclaredMethod("getSelectedUIState");
getSelectedUIStateMethod.setAccessible(true);
if (getSelectedUIMethod.invoke(null) != componentUI) {
throw new RuntimeException("getSelectedUI returns invalid value");
}
if (((Integer) getSelectedUIStateMethod.invoke(null)).intValue() !=
(SynthConstants.SELECTED | SynthConstants.FOCUSED)) {
throw new RuntimeException("getSelectedUIState returns invalid value");
}
}
private static void validate() throws Exception {
Method getSelectedUIMethod = SynthLookAndFeel.class.getDeclaredMethod("getSelectedUI");
getSelectedUIMethod.setAccessible(true);
Method getSelectedUIStateMethod = SynthLookAndFeel.class.getDeclaredMethod("getSelectedUIState");
getSelectedUIStateMethod.setAccessible(true);
if (getSelectedUIMethod.invoke(null) != componentUI) {
throw new RuntimeException("getSelectedUI returns invalid value");
}
if (((Integer) getSelectedUIStateMethod.invoke(null)).intValue() !=
(SynthConstants.SELECTED | SynthConstants.FOCUSED)) {
throw new RuntimeException("getSelectedUIState returns invalid value");
}
}
private static void validate() throws Exception {
Method getSelectedUIMethod = SynthLookAndFeel.class.getDeclaredMethod("getSelectedUI");
getSelectedUIMethod.setAccessible(true);
Method getSelectedUIStateMethod = SynthLookAndFeel.class.getDeclaredMethod("getSelectedUIState");
getSelectedUIStateMethod.setAccessible(true);
if (getSelectedUIMethod.invoke(null) != componentUI) {
throw new RuntimeException("getSelectedUI returns invalid value");
}
if (((Integer) getSelectedUIStateMethod.invoke(null)).intValue() !=
(SynthConstants.SELECTED | SynthConstants.FOCUSED)) {
throw new RuntimeException("getSelectedUIState returns invalid value");
}
}
/**
* @inheritDoc
*/
@Override
protected void paintExpandControl(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row,
boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) {
// modify the paintContext's state to match the state for the row
// this is a hack in that it requires knowledge of the subsequent
// method calls. The point is, the context used in drawCentered
// should reflect the state of the row, not of the tree.
boolean isSelected = tree.getSelectionModel().isPathSelected(path);
int state = paintContext.getComponentState();
if (isSelected) {
paintContext.setComponentState(state | SynthConstants.SELECTED);
}
super.paintExpandControl(g, clipBounds, insets, bounds, path, row, isExpanded, hasBeenExpanded, isLeaf);
paintContext.setComponentState(state);
}
private static void validate() throws Exception {
Method getSelectedUIMethod = SynthLookAndFeel.class.getDeclaredMethod("getSelectedUI");
getSelectedUIMethod.setAccessible(true);
Method getSelectedUIStateMethod = SynthLookAndFeel.class.getDeclaredMethod("getSelectedUIState");
getSelectedUIStateMethod.setAccessible(true);
if (getSelectedUIMethod.invoke(null) != componentUI) {
throw new RuntimeException("getSelectedUI returns invalid value");
}
if (((Integer) getSelectedUIStateMethod.invoke(null)).intValue() !=
(SynthConstants.SELECTED | SynthConstants.FOCUSED)) {
throw new RuntimeException("getSelectedUIState returns invalid value");
}
}
private static String toString(int state) {
StringBuffer buffer = new StringBuffer();
if ((state & SynthConstants.DEFAULT) == SynthConstants.DEFAULT) {
buffer.append("Default");
}
if ((state & SynthConstants.DISABLED) == SynthConstants.DISABLED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Disabled");
}
if ((state & SynthConstants.ENABLED) == SynthConstants.ENABLED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Enabled");
}
if ((state & SynthConstants.FOCUSED) == SynthConstants.FOCUSED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Focused");
}
if ((state & SynthConstants.MOUSE_OVER) == SynthConstants.MOUSE_OVER) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("MouseOver");
}
if ((state & SynthConstants.PRESSED) == SynthConstants.PRESSED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Pressed");
}
if ((state & SynthConstants.SELECTED) == SynthConstants.SELECTED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Selected");
}
return buffer.toString();
}
private static String toString(int state) {
StringBuffer buffer = new StringBuffer();
if ((state & SynthConstants.DEFAULT) == SynthConstants.DEFAULT) {
buffer.append("Default");
}
if ((state & SynthConstants.DISABLED) == SynthConstants.DISABLED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Disabled");
}
if ((state & SynthConstants.ENABLED) == SynthConstants.ENABLED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Enabled");
}
if ((state & SynthConstants.FOCUSED) == SynthConstants.FOCUSED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Focused");
}
if ((state & SynthConstants.MOUSE_OVER) == SynthConstants.MOUSE_OVER) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("MouseOver");
}
if ((state & SynthConstants.PRESSED) == SynthConstants.PRESSED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Pressed");
}
if ((state & SynthConstants.SELECTED) == SynthConstants.SELECTED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Selected");
}
return buffer.toString();
}
private static String toString(int state) {
StringBuffer buffer = new StringBuffer();
if ((state & SynthConstants.DEFAULT) == SynthConstants.DEFAULT) {
buffer.append("Default");
}
if ((state & SynthConstants.DISABLED) == SynthConstants.DISABLED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Disabled");
}
if ((state & SynthConstants.ENABLED) == SynthConstants.ENABLED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Enabled");
}
if ((state & SynthConstants.FOCUSED) == SynthConstants.FOCUSED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Focused");
}
if ((state & SynthConstants.MOUSE_OVER) == SynthConstants.MOUSE_OVER) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("MouseOver");
}
if ((state & SynthConstants.PRESSED) == SynthConstants.PRESSED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Pressed");
}
if ((state & SynthConstants.SELECTED) == SynthConstants.SELECTED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Selected");
}
return buffer.toString();
}
private static String toString(int state) {
StringBuffer buffer = new StringBuffer();
if ((state & SynthConstants.DEFAULT) == SynthConstants.DEFAULT) {
buffer.append("Default");
}
if ((state & SynthConstants.DISABLED) == SynthConstants.DISABLED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Disabled");
}
if ((state & SynthConstants.ENABLED) == SynthConstants.ENABLED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Enabled");
}
if ((state & SynthConstants.FOCUSED) == SynthConstants.FOCUSED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Focused");
}
if ((state & SynthConstants.MOUSE_OVER) == SynthConstants.MOUSE_OVER) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("MouseOver");
}
if ((state & SynthConstants.PRESSED) == SynthConstants.PRESSED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Pressed");
}
if ((state & SynthConstants.SELECTED) == SynthConstants.SELECTED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Selected");
}
return buffer.toString();
}
private static String toString(int state) {
StringBuffer buffer = new StringBuffer();
if ((state & SynthConstants.DEFAULT) == SynthConstants.DEFAULT) {
buffer.append("Default");
}
if ((state & SynthConstants.DISABLED) == SynthConstants.DISABLED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Disabled");
}
if ((state & SynthConstants.ENABLED) == SynthConstants.ENABLED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Enabled");
}
if ((state & SynthConstants.FOCUSED) == SynthConstants.FOCUSED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Focused");
}
if ((state & SynthConstants.MOUSE_OVER) == SynthConstants.MOUSE_OVER) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("MouseOver");
}
if ((state & SynthConstants.PRESSED) == SynthConstants.PRESSED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Pressed");
}
if ((state & SynthConstants.SELECTED) == SynthConstants.SELECTED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Selected");
}
return buffer.toString();
}
private static String toString(int state) {
StringBuffer buffer = new StringBuffer();
if ((state & SynthConstants.DEFAULT) == SynthConstants.DEFAULT) {
buffer.append("Default");
}
if ((state & SynthConstants.DISABLED) == SynthConstants.DISABLED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Disabled");
}
if ((state & SynthConstants.ENABLED) == SynthConstants.ENABLED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Enabled");
}
if ((state & SynthConstants.FOCUSED) == SynthConstants.FOCUSED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Focused");
}
if ((state & SynthConstants.MOUSE_OVER) == SynthConstants.MOUSE_OVER) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("MouseOver");
}
if ((state & SynthConstants.PRESSED) == SynthConstants.PRESSED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Pressed");
}
if ((state & SynthConstants.SELECTED) == SynthConstants.SELECTED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Selected");
}
return buffer.toString();
}
public void paintInterior(Graphics g, Component c) {
GtkEditorTabCellRenderer ren = (GtkEditorTabCellRenderer) c;
Polygon p = getInteriorPolygon(c);
int state = ren.isSelected() ? ren.isActive() ? SynthConstants.FOCUSED
: SynthConstants.SELECTED : SynthConstants.DEFAULT;
Rectangle bounds = p.getBounds();
int yDiff = getHeightDifference(ren);
paintTabBackground(g, 0, state, bounds.x, bounds.y + yDiff,
bounds.width, bounds.height - yDiff);
}
public void paintInterior(Graphics g, Component c) {
GtkEditorTabCellRenderer ren = (GtkEditorTabCellRenderer) c;
Polygon p = getInteriorPolygon(c);
int state = ren.isSelected() ? ren.isActive() ? SynthConstants.FOCUSED
: SynthConstants.SELECTED : SynthConstants.DEFAULT;
Rectangle bounds = p.getBounds();
int yDiff = getHeightDifference(ren);
paintTabBackground(g, 0, state, bounds.x, bounds.y + yDiff,
bounds.width, bounds.height - yDiff);
}
/** Paint bumps to specific Graphics. */
@Override
public void paint (Graphics g) {
Icon icon = UIManager.getIcon("ToolBar.handleIcon");
Region region = Region.TOOL_BAR;
SynthStyleFactory sf = SynthLookAndFeel.getStyleFactory();
SynthStyle style = sf.getStyle(toolbar, region);
SynthContext context = new SynthContext(toolbar, region, style, SynthConstants.DEFAULT);
SynthGraphicsUtils sgu = context.getStyle().getGraphicsUtils(context);
sgu.paintText(context, g, null, icon, SwingConstants.LEADING, SwingConstants.LEADING, 0, 0, 0, -1, 0);
}
private static String toString(int state) {
StringBuffer buffer = new StringBuffer();
if ((state & SynthConstants.DEFAULT) == SynthConstants.DEFAULT) {
buffer.append("Default");
}
if ((state & SynthConstants.DISABLED) == SynthConstants.DISABLED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Disabled");
}
if ((state & SynthConstants.ENABLED) == SynthConstants.ENABLED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Enabled");
}
if ((state & SynthConstants.FOCUSED) == SynthConstants.FOCUSED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Focused");
}
if ((state & SynthConstants.MOUSE_OVER) == SynthConstants.MOUSE_OVER) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("MouseOver");
}
if ((state & SynthConstants.PRESSED) == SynthConstants.PRESSED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Pressed");
}
if ((state & SynthConstants.SELECTED) == SynthConstants.SELECTED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Selected");
}
return buffer.toString();
}
private static String toString(int state) {
StringBuilder sb = new StringBuilder();
if ((state & SynthConstants.DEFAULT) == SynthConstants.DEFAULT) {
sb.append("Default");
}
if ((state & SynthConstants.DISABLED) == SynthConstants.DISABLED) {
if (sb.length() > 0) sb.append("+");
sb.append("Disabled");
}
if ((state & SynthConstants.ENABLED) == SynthConstants.ENABLED) {
if (sb.length() > 0) sb.append("+");
sb.append("Enabled");
}
if ((state & SynthConstants.FOCUSED) == SynthConstants.FOCUSED) {
if (sb.length() > 0) sb.append("+");
sb.append("Focused");
}
if ((state & SynthConstants.MOUSE_OVER) == SynthConstants.MOUSE_OVER) {
if (sb.length() > 0) sb.append("+");
sb.append("MouseOver");
}
if ((state & SynthConstants.PRESSED) == SynthConstants.PRESSED) {
if (sb.length() > 0) sb.append("+");
sb.append("Pressed");
}
if ((state & SynthConstants.SELECTED) == SynthConstants.SELECTED) {
if (sb.length() > 0) sb.append("+");
sb.append("Selected");
}
return sb.toString();
}
private static String toString(int state) {
StringBuilder sb = new StringBuilder();
if ((state & SynthConstants.DEFAULT) == SynthConstants.DEFAULT) {
sb.append("Default");
}
if ((state & SynthConstants.DISABLED) == SynthConstants.DISABLED) {
if (sb.length() > 0) sb.append("+");
sb.append("Disabled");
}
if ((state & SynthConstants.ENABLED) == SynthConstants.ENABLED) {
if (sb.length() > 0) sb.append("+");
sb.append("Enabled");
}
if ((state & SynthConstants.FOCUSED) == SynthConstants.FOCUSED) {
if (sb.length() > 0) sb.append("+");
sb.append("Focused");
}
if ((state & SynthConstants.MOUSE_OVER) == SynthConstants.MOUSE_OVER) {
if (sb.length() > 0) sb.append("+");
sb.append("MouseOver");
}
if ((state & SynthConstants.PRESSED) == SynthConstants.PRESSED) {
if (sb.length() > 0) sb.append("+");
sb.append("Pressed");
}
if ((state & SynthConstants.SELECTED) == SynthConstants.SELECTED) {
if (sb.length() > 0) sb.append("+");
sb.append("Selected");
}
return sb.toString();
}
private static void testSynthIcon() {
if (!checkAndSetNimbusLookAndFeel()) {
return;
}
JMenuItem menu = new JMenuItem();
Icon subMenuIcon = UIManager.getIcon("Menu.arrowIcon");
if (!(subMenuIcon instanceof SynthIcon)) {
throw new RuntimeException("Icon is not a SynthIcon!");
}
Region region = SynthLookAndFeel.getRegion(menu);
SynthStyle style = SynthLookAndFeel.getStyle(menu, region);
SynthContext synthContext = new SynthContext(menu, region, style, SynthConstants.ENABLED);
int width = SynthGraphicsUtils.getIconWidth(subMenuIcon, synthContext);
int height = SynthGraphicsUtils.getIconHeight(subMenuIcon, synthContext);
paintAndCheckIcon(subMenuIcon, synthContext, width, height);
int newWidth = width * 17;
int newHeight = height * 37;
Icon centeredIcon = new CenteredSynthIcon((SynthIcon) subMenuIcon,
newWidth, newHeight);
paintAndCheckIcon(centeredIcon, synthContext, newWidth, newHeight);
}
private static String toString(int state) {
StringBuffer buffer = new StringBuffer();
if ((state & SynthConstants.DEFAULT) == SynthConstants.DEFAULT) {
buffer.append("Default");
}
if ((state & SynthConstants.DISABLED) == SynthConstants.DISABLED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Disabled");
}
if ((state & SynthConstants.ENABLED) == SynthConstants.ENABLED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Enabled");
}
if ((state & SynthConstants.FOCUSED) == SynthConstants.FOCUSED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Focused");
}
if ((state & SynthConstants.MOUSE_OVER) == SynthConstants.MOUSE_OVER) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("MouseOver");
}
if ((state & SynthConstants.PRESSED) == SynthConstants.PRESSED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Pressed");
}
if ((state & SynthConstants.SELECTED) == SynthConstants.SELECTED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Selected");
}
return buffer.toString();
}
private static String toString(int state) {
StringBuffer buffer = new StringBuffer();
if ((state & SynthConstants.DEFAULT) == SynthConstants.DEFAULT) {
buffer.append("Default");
}
if ((state & SynthConstants.DISABLED) == SynthConstants.DISABLED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Disabled");
}
if ((state & SynthConstants.ENABLED) == SynthConstants.ENABLED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Enabled");
}
if ((state & SynthConstants.FOCUSED) == SynthConstants.FOCUSED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Focused");
}
if ((state & SynthConstants.MOUSE_OVER) == SynthConstants.MOUSE_OVER) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("MouseOver");
}
if ((state & SynthConstants.PRESSED) == SynthConstants.PRESSED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Pressed");
}
if ((state & SynthConstants.SELECTED) == SynthConstants.SELECTED) {
if (buffer.length() > 0) buffer.append("+");
buffer.append("Selected");
}
return buffer.toString();
}