private static boolean insetsTest(Insets[] ins1, Object obj) { if (ins1 == obj) return true; if (!(obj instanceof Insets[])) return false; Insets[] ins2 = (Insets[]) obj; if (ins1 == null || ins2 == null) return false; if (ins1.length != 2 || ins2.length != 2 || ins1[0] == null || ins1[1] == null || ins2[0] == null || ins2[1] == null || !ins1[0].equals(ins2[0]) || !ins1[1].equals(ins2[1])) return false; return true; } // NOTE: This is NOT synchronized because that can deadlock when you release another image when allocating a new one; but
public boolean equals(Object obj) { if (obj == this) { return true; } if (! (obj instanceof DefaultCellStyle)) { return false; } DefaultCellStyle s = (DefaultCellStyle) obj; return horizontalAlignment == s.horizontalAlignment && verticalAlignment == s.verticalAlignment && (fgColor == s.fgColor ? true : fgColor.equals(s.fgColor)) && (bgColor == s.bgColor ? true : bgColor.equals(s.bgColor)) && (font == s.font ? true : font.equals(s.font)) && (border == s.border ? true : border.equals(s.border)) && (padding == s.padding ? true : padding.equals(s.padding)) && (formatter == s.formatter ? true : formatter .equals(s.formatter)); }
/** * Constructs and returns a string representation of this constraints object. * * @return string representation of this constraints object */ public String toString() { StringBuffer buffer = new StringBuffer("CellConstraints"); buffer.append("[x="); buffer.append(gridX); buffer.append("; y="); buffer.append(gridY); buffer.append("; w="); buffer.append(gridWidth); buffer.append("; h="); buffer.append(gridHeight); buffer.append("; hAlign="); buffer.append(hAlign); buffer.append("; vAlign="); buffer.append(vAlign); if (!(EMPTY_INSETS.equals(insets))) { buffer.append("; insets="); buffer.append(insets); } buffer.append("; honorsVisibility="); buffer.append(honorsVisibility); buffer.append(']'); return buffer.toString(); }
/** * Constructs and returns a string representation of this constraints object. * * @return string representation of this constraints object */ @Override public String toString() { StringBuffer buffer = new StringBuffer("CellConstraints"); buffer.append("[x="); buffer.append(gridX); buffer.append("; y="); buffer.append(gridY); buffer.append("; w="); buffer.append(gridWidth); buffer.append("; h="); buffer.append(gridHeight); buffer.append("; hAlign="); buffer.append(hAlign); buffer.append("; vAlign="); buffer.append(vAlign); if (!EMPTY_INSETS.equals(insets)) { buffer.append("; insets="); buffer.append(insets); } buffer.append("; honorsVisibility="); buffer.append(honorsVisibility); buffer.append(']'); return buffer.toString(); }
/** * Constructs and returns a string representation of this constraints * object. * * @return string representation of this constraints object */ public String toString() { StringBuffer buffer = new StringBuffer("CellConstraints"); buffer.append("[x="); buffer.append(gridX); buffer.append("; y="); buffer.append(gridY); buffer.append("; w="); buffer.append(gridWidth); buffer.append("; h="); buffer.append(gridHeight); buffer.append("; hAlign="); buffer.append(hAlign); buffer.append("; vAlign="); buffer.append(vAlign); if (!(EMPTY_INSETS.equals(insets))) { buffer.append("; insets="); buffer.append(insets); } buffer.append(']'); return buffer.toString(); }
/** * Constructs and returns a string representation of this constraints object. * * @return string representation of this constraints object */ @Override public String toString() { StringBuffer buffer = new StringBuffer("CellConstraints"); buffer.append("[x="); buffer.append(gridX); buffer.append("; y="); buffer.append(gridY); buffer.append("; w="); buffer.append(gridWidth); buffer.append("; h="); buffer.append(gridHeight); buffer.append("; hAlign="); buffer.append(hAlign); buffer.append("; vAlign="); buffer.append(vAlign); if (!EMPTY_INSETS.equals(insets)) { buffer.append("; insets="); buffer.append(insets); } buffer.append("; honorsVisibility="); buffer.append(honorsVisibility); buffer.append(']'); return buffer.toString(); }
/** * Tests this instance for equality with an arbitrary object. * * @param obj the object ({@code null} permitted). * * @return A boolean. */ @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof AbstractTableElement)) { return false; } AbstractTableElement that = (AbstractTableElement) obj; if (!this.insets.equals(that.insets)) { return false; } if (!ObjectUtils.equals(this.background, that.background)) { return false; } return true; }
protected void recalculateIfInsetsChanged() { Insets newInsets = slider.getInsets(); if (!newInsets.equals(insetCache)) { insetCache = newInsets; calculateGeometry(); } }
protected void recalculateIfInsetsChanged() { Insets newInsets = slider.getInsets(); if (!newInsets.equals(insetCache)) { insetCache = newInsets; calculateGeometry(); } }
public boolean applyChangedOptions(Properties options) { boolean changed = false; Insets margins = new Insets(((Number) top.getValue()).intValue(), ((Number) left.getValue()).intValue(), ((Number) bottom .getValue()).intValue(), ((Number) right.getValue()) .intValue()); if (!margins.equals(initialMargins)) { UserProperties.setProperty(options, key, margins); changed = true; } return changed; }
public void actionPerformed(ActionEvent event) { Insets margins = new Insets(((Number) top.getValue()).intValue(), ((Number) left.getValue()).intValue(), ((Number) bottom .getValue()).intValue(), ((Number) right.getValue()).intValue()); for (int i = 1; i < pageMarginList.length; i++) { Insets insets = PageConstants.getMargins(pageMarginList[i]); if (margins.equals(insets)) { pageMarginCombo.setSelectedIndex(i); return; } } pageMarginCombo.setSelectedIndex(0); // Custom } }
public boolean applyChangedOptions(Properties options) { boolean changed = false; Insets margins = new Insets(((Number) top.getValue()).intValue(), ((Number) left.getValue()).intValue(), ((Number) bottom .getValue()).intValue(), ((Number) right.getValue()) .intValue()); if (!margins.equals(initialMargins)) { UserProperties.setProperty(options, key, margins); changed = true; } return changed; }
public void actionPerformed(ActionEvent event) { Insets margins = new Insets(((Number) top.getValue()).intValue(), ((Number) left.getValue()).intValue(), ((Number) bottom .getValue()).intValue(), ((Number) right.getValue()).intValue()); for (int i = 1; i < pageMarginList.length; i++) { Insets insets = PageConstants.getMargins(pageMarginList[i]); if (margins.equals(insets)) { pageMarginCombo.setSelectedIndex(i); return; } } pageMarginCombo.setSelectedIndex(0); // Custom } }
/** * Sets the border of the widget. * @param border the border */ public final void setBorder (Border border) { assert border != null; boolean repaintOnly = this.border.getInsets ().equals (border.getInsets ()); this.border = border; revalidate (repaintOnly); }
/** * Sets the border of the widget. * @param border the border */ public final void setBorder (Border border) { assert border != null; boolean repaintOnly = this.border.getInsets ().equals (border.getInsets ()); this.border = border; revalidate (repaintOnly); }
public JBTabsPresentation setPaintBorder(int top, int left, int right, int bottom) { final Insets newBorder = new Insets( JBTabsImpl.getBorder(top), JBTabsImpl.getBorder(left), JBTabsImpl.getBorder(bottom), JBTabsImpl.getBorder(right)); if (newBorder.equals(myBorderSize)) return myTabs; myBorderSize = newBorder; myEffectiveBorder = null; myTabs.relayout(true, false); return myTabs; }
protected void recalculateIfInsetsChanged() { SeaGlassContext context = getContext(slider); Insets newInsets = style.getInsets(context, null); if (!newInsets.equals(insetCache)) { insetCache = newInsets; calculateGeometry(); } context.dispose(); }
/** * Applys a border to this customizer. </br> * Usually you will use this method rather than setBorder. * @param border a border */ public void applyBorder(Border border) { getGlassPane().setBorder(border); // painted on glass pane so the handles of HandleBorder are always visible Insets insets = getGlassPane().getInsets(); if (! insets.equals(getComponentContainer().getInsets())){ getComponentContainer().setBorder(BorderFactory.createEmptyBorder(insets.top, insets.left, insets.bottom, insets.right)); } // System.out.println("bounds before: "+getComponent().getBounds()); // Insets insets = getGlassPane().getInsets(); // getComponentContainer().setBorder(BorderFactory.createEmptyBorder(insets.top, insets.left, insets.bottom, insets.right)); // getComponentContainer().doLayout(); // System.out.println("bounds after: "+getComponent().getBounds()); // repaint(); }
public void updateUI() { super.updateUI(); setRolloverEnabled(true); if(BuLib.isOcean()) { Insets i=getMargin(); if((i instanceof UIResource)&&REF.equals(i)) setMargin(ALT); } }
public void updateUI() { super.updateUI(); setRolloverEnabled(true); if(BuLib.isOcean()) { Insets i=getMargin(); if((i instanceof UIResource)&&REF.equals(i)) setMargin(ALT); } }