public void changeData(byte[] bytes) { if (mainPane.getComponentCount() > 0) { mainPane.removeAll(); } HexModel model = new HexModel(bytes); mainPane.add(new HexEditor(model)); mainPane.validate(); }
@Override protected boolean isIgnored( JComponent component ) { return component instanceof Stub && component.getComponentCount() == 0; } }
@Override protected boolean isIgnored( JComponent component ) { return component instanceof Stub && component.getComponentCount() == 0; } }
@Override protected boolean isIgnored( JComponent component ) { return component instanceof Stub && component.getComponentCount() == 0; } }
@Override protected boolean isIgnored( JComponent component ) { return component instanceof Stub && component.getComponentCount() == 0; } }
public BCalqueLegendePanel getLegendePanel(final int _i) { if (_i >= 0 && (_i < pnLegendes_.getComponentCount())) { return ((BCalqueLegendePanel) pnLegendes_.getComponent(_i)); } return null; }
/** * Gets the number of buttons that are actually shown. * @return the number of buttons */ public int getNumberOfButtons(){ return getContentPane().getComponentCount(); }
/** * Overridden to build widgets just-in-time. * <p> * This method may be called by developers who wish to modify the created Components before they * are displayed. */ @Override public int getComponentCount() { buildWidgets(); return super.getComponentCount(); }
public BCalqueAffichage getLegendDisplayAtPosition(final int _i) { if (_i >= 0 && (_i < pnLegendes_.getComponentCount())) { return ((BCalqueLegendePanel) pnLegendes_.getComponent(_i)).aff_; } return null; }
/** * Overridden to build widgets just-in-time. * <p> * This method may be called by developers who wish to modify the created Components before they * are displayed. */ @Override public int getComponentCount() { buildWidgets(); return super.getComponentCount(); }
/** * @param _parent le composant partir duquel la recherche commence * @param _name le nom du composant fils chercher * @return le fils direct de _parent ayant le nom donne ou null si non trouve */ public static JComponent findChildByName(JComponent _parent, String _name) { if (_parent == null || _name == null) return null; for (int i = _parent.getComponentCount() - 1; i >= 0; i--) { if (_name.equals(_parent.getComponent(i).getName())) return (JComponent) _parent.getComponent(i); } return null; }
public void installUI(JComponent c) { super.installUI(c); c.putClientProperty("gradientStart", UIManager.get("ToolBar.gradientStart")); c.putClientProperty("gradientEnd", UIManager.get("ToolBar.gradientEnd")); int limit = c.getComponentCount(); for (int i = 0; i < limit; i++) { setToolBarUI((JComponent) c.getComponent(i)); } }
JComponent editor = spinner.getEditor(); int n = editor.getComponentCount(); for (int i=0; i<n; i++) { Component c = editor.getComponent(i); if (c instanceof JTextField) { c.setForeground(Color.red); c.setBackground(Color.red); } }
public void setColor(Color color) { JComponent editor = this.getEditor(); int numberOfComps = editor.getComponentCount(); for(int i = 0; i < numberOfComps; i++) { editor.getComponent(i).setBackground(color); } } }
private void internSetFont(final JComponent _c, final Font _font) { for (int i = _c.getComponentCount() - 1; i >= 0; i--) { _c.getComponent(i).setFont(_font); } }
private void selectAll(final JComponent parent, boolean selected) { for (int i = 0; i < parent.getComponentCount(); i++) { Component c = parent.getComponent(i); if (c instanceof AbstractButton) { ((AbstractButton) c).setSelected(selected); } } itemList.forEach(m -> m.setSelected(selected)); }
public static void setFocusableRecursive(Component aComp, boolean aValue) { aComp.setFocusable(aValue); if (aComp instanceof JComponent) { JComponent jComp = (JComponent) aComp; for (int i = 0; i < jComp.getComponentCount(); i++) { setFocusableRecursive(jComp.getComponent(i), aValue); } } }
protected static void addKeyListener(final Component _c, final KeyListener _key) { if (_c != null) { _c.addKeyListener(_key); if (_c instanceof JComponent) { final JComponent jc = (JComponent) _c; for (int i = jc.getComponentCount() - 1; i >= 0; i--) { addKeyListener(jc.getComponent(i), _key); } } } }
public void setMainToolBar(BuToolBar _tb) { main_toolbar_ = _tb; if (!(getApp() instanceof BuSubApp)) { if ((content_.getComponentCount() > 1) && (content_.getComponent(1) != null)) content_.remove(1); if (main_toolbar_ != null) { content_.add(main_toolbar_, BuBorderLayout.NORTH); main_toolbar_.revalidate(); // content_.doLayout(); // content_.validate(); } } }
public static void toBack(JComponent aParent, JComponent aComp, int aCount) { int zOrder = aParent.getComponentZOrder(aComp); if ((zOrder + aCount) < aParent.getComponentCount()) { aParent.setComponentZOrder(aComp, zOrder + aCount); aParent.revalidate(); aParent.repaint(); } } }