rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
}
public void paint(Graphics g, JComponent c) { JTree tree = (JTree) c; TreeModel mod = tree.getModel(); Object root = mod.getRoot(); if (!tree.isRootVisible()) tree.expandPath(new TreePath(root)); paintRecursive(g, 0, 0, 0, 0, tree, mod, root); if (hasControlIcons()) ...
if (tree.isExpanded(new TreePath(getPathToRoot(((TreeNode) node), 0))))
if (tree.isExpanded(new TreePath(getPathToRoot(node, 0))))
int paintControlIcons(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object node) { int h = descent; int rowHeight = getRowHeight(); Icon ei = UIManager.getLookAndFeelDefaults() .getIcon("Tree.expandedIcon"); Icon ci = UIManager....
drawCentered(tree, g, ei, indentation - rightChildIndent - 3, h);
ei.paintIcon(tree, g, indentation - rightChildIndent - 3, h);
int paintControlIcons(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object node) { int h = descent; int rowHeight = getRowHeight(); Icon ei = UIManager.getLookAndFeelDefaults() .getIcon("Tree.expandedIcon"); Icon ci = UIManager....
for (int i = 0; i < max; ++i)
for (int i = 0; i < max; i++)
int paintControlIcons(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object node) { int h = descent; int rowHeight = getRowHeight(); Icon ei = UIManager.getLookAndFeelDefaults() .getIcon("Tree.expandedIcon"); Icon ci = UIManager....
drawCentered(tree, g, ei, indentation - rightChildIndent - 3,
ci.paintIcon(tree, g, indentation - rightChildIndent - 3,
int paintControlIcons(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object node) { int h = descent; int rowHeight = getRowHeight(); Icon ei = UIManager.getLookAndFeelDefaults() .getIcon("Tree.expandedIcon"); Icon ci = UIManager....
TreePath curr = new TreePath(getPathToRoot(((TreeNode) node), 0));
TreePath curr = new TreePath(getPathToRoot(node, 0));
void paintNode(Graphics g, int x, int y, JTree tree, Object node, boolean isLeaf) { TreePath curr = new TreePath(getPathToRoot(((TreeNode) node), 0)); boolean selected = tree.isPathSelected(curr); boolean expanded = false; boolean hasIcons = false; if (tree.isVisible(curr)) { ...
DefaultTreeCellRenderer dtcr = (DefaultTreeCellRenderer) createDefaultCellRenderer();
TreeCellRenderer dtcr = tree.getCellRenderer(); if (dtcr == null) dtcr = createDefaultCellRenderer();
void paintNode(Graphics g, int x, int y, JTree tree, Object node, boolean isLeaf) { TreePath curr = new TreePath(getPathToRoot(((TreeNode) node), 0)); boolean selected = tree.isPathSelected(curr); boolean expanded = false; boolean hasIcons = false; if (tree.isVisible(curr)) { ...
Icon icon = null; if (!isLeaf && expanded) icon = dtcr.getOpenIcon(); else if (!isLeaf && !expanded) icon = dtcr.getClosedIcon(); else icon = dtcr.getLeafIcon(); if (icon.getIconHeight() > -1 && icon.getIconWidth() > -1) hasIcons = true;
void paintNode(Graphics g, int x, int y, JTree tree, Object node, boolean isLeaf) { TreePath curr = new TreePath(getPathToRoot(((TreeNode) node), 0)); boolean selected = tree.isPathSelected(curr); boolean expanded = false; boolean hasIcons = false; if (tree.isVisible(curr)) { ...
expanded, isLeaf, 0, false); if (hasIcons) { if (selected) { Rectangle cell = getPathBounds(tree, curr); g.setColor(dtcr.getBackgroundSelectionColor()); g.fillRect(cell.x + icon.getIconWidth()/2, cell.y, cell.width, cell.height); if (curr.equals(tree.getLeadSelectionPath())) { g.setColor(UIManager.getLookAndFeelDefau...
expanded, isLeaf, 0, false); rendererPane.paintComponent(g, c, c.getParent(), getCellBounds(x, y, node));
void paintNode(Graphics g, int x, int y, JTree tree, Object node, boolean isLeaf) { TreePath curr = new TreePath(getPathToRoot(((TreeNode) node), 0)); boolean selected = tree.isPathSelected(curr); boolean expanded = false; boolean hasIcons = false; if (tree.isVisible(curr)) { ...
if (tree.isExpanded(new TreePath(getPathToRoot(((TreeNode) curr), 0))))
if (tree.isExpanded(new TreePath(getPathToRoot(curr, 0))))
int paintRecursive(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = g.getClipBounds(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; int halfH...
for (int i = 0; i < max; ++i)
for (int i = 0; i < max; i++)
int paintRecursive(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = g.getClipBounds(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; int halfH...
if (tree.isExpanded(new TreePath(getPathToRoot(((TreeNode) curr), 0)))) if (y0 != heightOfLine)
if (tree.isExpanded(new TreePath(getPathToRoot(curr, 0)))) if (y0 != heightOfLine && mod.getChildCount(curr) > 0)
int paintRecursive(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = g.getClipBounds(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; int halfH...
tree.setCellRenderer(tcr);
protected void setCellRenderer(TreeCellRenderer tcr) { currentCellRenderer = tcr; updateRenderer(); }
treeModel = model;
treeModel = tree.getModel();
protected void setModel(TreeModel model) { tree.setModel(model); treeModel = model; }
UIDefaults defaults = UIManager.getLookAndFeelDefaults();
protected void uninstallDefaults(JTree tree) { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); tree.setFont(null); tree.setForeground(null); tree.setBackground(null); tree.setCellRenderer(null); }
tree.setCellRenderer(null);
protected void uninstallDefaults(JTree tree) { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); tree.setFont(null); tree.setForeground(null); tree.setBackground(null); tree.setCellRenderer(null); }
attribHash.put(DESCRIPTION_XML_ATTRIBUTE_NAME, new Attribute(null, Constants.STRING_TYPE));
protected void init() { resetAttributes(); classXDFNodeName = "units"; XDFNodeName = classXDFNodeName; // order matters! these are in *reverse* order of their // occurence in the XDF DTD attribOrder.add(0,"unitList"); attribOrder.add(0,"system"); attribOrder.add(0,"factor"); attribHash.put...
g.setColor(borderColor);
if(MetalLookAndFeel.getCurrentTheme() instanceof OceanTheme) g.setColor(UIManager.getColor("MenuBar.borderColor")); else g.setColor(MetalLookAndFeel.getControlShadow());
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { g.setColor(borderColor); g.drawLine(x, y + h - 1, x + w, y + h - 1); }
out.println("Address 0x" + NumberUtils.hex(mem.getAddress().toInt())); out.println("Size " + mem.getSize());
out.println("Address 0x" + MagicUtils.toString(mem.getAddress())); out.println("Size " + MagicUtils.toString(mem.getSize()));
public void dump(PrintStream out) { out.println("MPConfigTable"); out.println("Address 0x" + NumberUtils.hex(mem.getAddress().toInt())); out.println("Size " + mem.getSize()); out.println("Manufacturer " + getOemID()); out.println("Product " + getPr...
out.println("Local APIC ptr 0x" + NumberUtils.hex(getLocalApicAddress().toInt()));
out.println("Local APIC ptr 0x" + MagicUtils.toString(getLocalApicAddress()));
public void dump(PrintStream out) { out.println("MPConfigTable"); out.println("Address 0x" + NumberUtils.hex(mem.getAddress().toInt())); out.println("Size " + mem.getSize()); out.println("Manufacturer " + getOemID()); out.println("Product " + getPr...
protected WordItem(int kind, Register reg, int local) { super(kind, local); this.reg = reg; assertCondition((kind != Kind.REGISTER) || (reg != null), "kind == register implies that reg != null");
protected WordItem(ItemFactory factory) { super(factory);
protected WordItem(int kind, Register reg, int local) { super(kind, local); this.reg = reg; assertCondition((kind != Kind.REGISTER) || (reg != null), "kind == register implies that reg != null"); }
res = createLocal(getType(), getOffsetToFP());
res = (WordItem)factory.createLocal(getType(), getOffsetToFP());
protected Item clone(EmitterContext ec) { final WordItem res; final AbstractX86Stream os = ec.getStream(); switch (getKind()) { case Kind.REGISTER: res = L1AHelper.requestWordRegister(ec, getType(), false); final Register r = res.getRegister(); os.writeMOV(INTSIZE, r, reg); break; case Kind.LOCAL: res =...
res = createStack(getType());
res = (WordItem)factory.createStack(getType());
protected Item clone(EmitterContext ec) { final WordItem res; final AbstractX86Stream os = ec.getStream(); switch (getKind()) { case Kind.REGISTER: res = L1AHelper.requestWordRegister(ec, getType(), false); final Register r = res.getRegister(); os.writeMOV(INTSIZE, r, reg); break; case Kind.LOCAL: res =...
final VirtualStack stack = ec.getVStack(); stack.operandStack.push(res);
final ItemStack operandStack = ec.getVStack().operandStack; operandStack.pop(this); operandStack.push(this); operandStack.push(res);
protected Item clone(EmitterContext ec) { final WordItem res; final AbstractX86Stream os = ec.getStream(); switch (getKind()) { case Kind.REGISTER: res = L1AHelper.requestWordRegister(ec, getType(), false); final Register r = res.getRegister(); os.writeMOV(INTSIZE, r, reg); break; case Kind.LOCAL: res =...
release(ec);
cleanup(ec);
final void loadTo(EmitterContext ec, Register reg) { assertCondition(reg != null, "Reg != null"); final AbstractX86Stream os = ec.getStream(); final X86RegisterPool pool = ec.getPool(); final VirtualStack stack = ec.getVStack(); assertCondition(!pool.isFree(reg), "reg not free"); switch (kind) { case Kind.REGIS...
release(ec);
cleanup(ec);
final void push(EmitterContext ec) { final AbstractX86Stream os = ec.getStream(); final VirtualStack stack = ec.getVStack(); switch (getKind()) { case Kind.REGISTER: os.writePUSH(reg); break; case Kind.LOCAL: os.writePUSH(FP, offsetToFP); break; case Kind.CONSTANT: pushConstant(ec, os); break; case ...
final X86RegisterPool pool = ec.getPool(); switch (getKind()) { case Kind.REGISTER: pool.release(reg); assertCondition(pool.isFree(reg), "reg is free"); break; case Kind.LOCAL: break; case Kind.CONSTANT: break; case Kind.FPUSTACK: break; case Kind.STACK: break; default: throw new IllegalArgumentException("Inv...
cleanup(ec); ec.getItemFactory().release(this);
final void release(EmitterContext ec) { //assertCondition(!ec.getVStack().contains(this), "Cannot release while // on vstack"); final X86RegisterPool pool = ec.getPool(); switch (getKind()) { case Kind.REGISTER: pool.release(reg); assertCondition(pool.isFree(reg), "reg is free"); break; case Kind.LOCAL: ...
log.debug("<<< BEGIN getCompatibleFont >>>");
final protected Font getCompatibleFont(Font font) { log.debug("<<< BEGIN getCompatibleFont >>>"); Font f = null; try { f = fontsByName.get(font.getFamily()); log.debug("requested font: name="+font.getName()+ " fontName="+font.getFontName()+ " family="+font.getFamily()); if(f == null) { f = f...
log.debug("requested font: name="+font.getName()+ " fontName="+font.getFontName()+ " family="+font.getFamily());
final protected Font getCompatibleFont(Font font) { log.debug("<<< BEGIN getCompatibleFont >>>"); Font f = null; try { f = fontsByName.get(font.getFamily()); log.debug("requested font: name="+font.getName()+ " fontName="+font.getFontName()+ " family="+font.getFamily()); if(f == null) { f = f...
log.debug("<<< END getCompatibleFont >>>");
final protected Font getCompatibleFont(Font font) { log.debug("<<< BEGIN getCompatibleFont >>>"); Font f = null; try { f = fontsByName.get(font.getFamily()); log.debug("requested font: name="+font.getName()+ " fontName="+font.getFontName()+ " family="+font.getFamily()); if(f == null) { f = f...
if(log.isDebugEnabled()) log.debug("created FontMetrics"+fm+" font="+font);
final public FontMetrics getFontMetrics(Font font) { FontMetrics fm = (FontMetrics) metrics.get(font); if(log.isDebugEnabled()) log.debug("FontMetrics got from cache: "+fm+" font="+font); if (fm == null) { try { fm = createFontMetrics(font); metrics.put(font, fm); if(log.isDebugEnabled()) log.debug("crea...
log.debug("provides, font="+font); if(font == null) return false;
if(font == null) return false;
final public boolean provides(Font font) { log.debug("provides, font="+font); if(font == null) return false; // don't provide default (null) fonts if (!fontsLoaded) { log.debug("provides, !fontsLoaded"); loadFonts(); } final Font f = getCompatibleFont(font); log.debug("provides, retu...
log.debug("provides, return "+(f != null));
final public boolean provides(Font font) { log.debug("provides, font="+font); if(font == null) return false; // don't provide default (null) fonts if (!fontsLoaded) { log.debug("provides, !fontsLoaded"); loadFonts(); } final Font f = getCompatibleFont(font); log.debug("provides, retu...
return KeyStroke.getKeyStroke(0,0);;
return KeyStroke.getKeyStroke(0,0);
public final static KeyStroke getKeyStroke(String which) { Collection v = mappedKeys.values(); Set o = mappedKeys.keySet(); Iterator k = o.iterator(); Iterator i = v.iterator(); while (k.hasNext()) { KeyStroker ks = (KeyStroker)k.next(); String keyVal = (String)i.next(); ...
if (ALLOWED_CLASSNAMES[a].equals(className))
if (ALLOWED_CLASSNAMES[a].equals(testString))
protected OpenType(String className, String name, String desc) throws OpenDataException { if (name == null || name.equals("")) throw new IllegalArgumentException("The name can not be null " + "or the empty string."); if (desc == null || desc.equals("")) throw new IllegalArgumentException("The...
throw new OpenDataException("The class name does not specify " + "a valid open type.");
throw new OpenDataException("The class name, " + testString + ", does not specify a valid open type.");
protected OpenType(String className, String name, String desc) throws OpenDataException { if (name == null || name.equals("")) throw new IllegalArgumentException("The name can not be null " + "or the empty string."); if (desc == null || desc.equals("")) throw new IllegalArgumentException("The...
setPopupVisible(comboBox, false);
public void focusLost(FocusEvent e) { hasFocus = false; comboBox.repaint(); }
if (e.getStateChange() == ItemEvent.SELECTED && comboBox.isEditable()) comboBox.getEditor().setItem(e.getItem());
public void itemStateChanged(ItemEvent e) { comboBox.repaint(); }
arrowButton.setMargin(new Insets(0, 0, 0, 0));
public void configureArrowButton() { arrowButton.setEnabled(comboBox.isEnabled()); arrowButton.setFont(comboBox.getFont()); arrowButton.setMargin(new Insets(0, 0, 0, 0)); }
return new BasicArrowButton(BasicArrowButton.SOUTH);
return new BasicArrowButton(BasicArrowButton.SOUTH, buttonBackground, buttonShadow, buttonDarkShadow, buttonHighlight);
protected JButton createArrowButton() { return new BasicArrowButton(BasicArrowButton.SOUTH); }
return new BasicComboBoxEditor();
return new BasicComboBoxEditor.UIResource();
protected ComboBoxEditor createEditor() { return new BasicComboBoxEditor(); }
return new Dimension(100, 5);
FontMetrics fm = comboBox.getFontMetrics(comboBox.getFont()); int w = fm.charWidth(' ') + 2; int h = fm.getHeight() + 2; return new Dimension(w, h);
protected Dimension getDefaultSize() { // FIXME: Not implemented properly. return new Dimension(100, 5); }
String s = item.toString(); Component comp = renderer.getListCellRendererComponent(listBox, item, -1, false, false);
Component comp = renderer.getListCellRendererComponent(listBox, item, -1, false, false);
protected Dimension getDisplaySize() { ComboBoxModel model = comboBox.getModel(); int numItems = model.getSize(); // if combo box doesn't have any items then simply // return its default size if (numItems == 0) { displaySize = getDefaultSize(); return displaySize; } Dimension size = new D...
if (compSize.width > size.width) size.width = compSize.width; if (compSize.height > size.height) size.height = compSize.height;
if (compSize.width + 2 > size.width) size.width = compSize.width + 2; if (compSize.height + 2 > size.height) size.height = compSize.height + 2;
protected Dimension getDisplaySize() { ComboBoxModel model = comboBox.getModel(); int numItems = model.getSize(); // if combo box doesn't have any items then simply // return its default size if (numItems == 0) { displaySize = getDefaultSize(); return displaySize; } Dimension size = new D...
}
protected Dimension getDisplaySize() { ComboBoxModel model = comboBox.getModel(); int numItems = model.getSize(); // if combo box doesn't have any items then simply // return its default size if (numItems == 0) { displaySize = getDefaultSize(); return displaySize; } Dimension size = new D...
Dimension arrowDim = arrowButton.getPreferredSize(); Dimension result = new Dimension(d.width + arrowDim.width, Math.max(d.height, arrowDim.height));
int arrowButtonWidth = d.height; Dimension result = new Dimension(d.width + arrowButtonWidth, d.height);
public Dimension getMinimumSize(JComponent c) { Dimension d = getDisplaySize(); Dimension arrowDim = arrowButton.getPreferredSize(); Dimension result = new Dimension(d.width + arrowDim.width, Math.max(d.height, arrowDim.height)); return result; }
arrowButton = createArrowButton(); configureArrowButton(); comboBox.add(arrowButton); listBox = new JList();
popup = createPopup(); listBox = popup.getList();
protected void installComponents() { // create and install arrow button arrowButton = createArrowButton(); configureArrowButton(); comboBox.add(arrowButton); // Set list that will be used by BasicComboBoxRender // in order to determine the right colors when rendering listBox = new JList(); /...
popup = createPopup();
}
protected void installComponents() { // create and install arrow button arrowButton = createArrowButton(); configureArrowButton(); comboBox.add(arrowButton); // Set list that will be used by BasicComboBoxRender // in order to determine the right colors when rendering listBox = new JList(); /...
shadow = UIManager.getColor("ComboBox.buttonShadow"); darkShadow = UIManager.getColor("ComboBox.buttonDarkShadow"); highlight = UIManager.getColor("ComboBox.buttonHighlight");
buttonBackground = UIManager.getColor("ComboBox.buttonBackground"); buttonShadow = UIManager.getColor("ComboBox.buttonShadow"); buttonDarkShadow = UIManager.getColor("ComboBox.buttonDarkShadow"); buttonHighlight = UIManager.getColor("ComboBox.buttonHighlight");
protected void installDefaults() { LookAndFeel.installColorsAndFont(comboBox, "ComboBox.background", "ComboBox.foreground", "ComboBox.font"); // fetch the button color scheme shadow = UIManager.getColor("ComboBox.buttonShadow"); darkShadow = UIManager.getColor("ComboBo...
}
protected void uninstallComponents() { // uninstall arrow button unconfigureArrowButton(); comboBox.remove(arrowButton); arrowButton = null; listBox = null; popup = null; comboBox.setRenderer(null); comboBox.setEditor(null); editor = null; }
shadow = null; darkShadow = null; highlight = null;
buttonBackground = null; buttonShadow = null; buttonDarkShadow = null; buttonHighlight = null;
protected void uninstallDefaults() { if (comboBox.getFont() instanceof UIResource) comboBox.setFont(null); if (comboBox.getForeground() instanceof UIResource) comboBox.setForeground(null); if (comboBox.getBackground() instanceof UIResource) comboBox.setBackground(null); shadow = null; ...
updateUI(); lightWeightPopupEnabled = DefaultLightWeightPopupEnabled; selectionModel = new DefaultSingleSelectionModel(); super.setVisible(false);
this(null);
public JPopupMenu() { updateUI(); lightWeightPopupEnabled = DefaultLightWeightPopupEnabled; selectionModel = new DefaultSingleSelectionModel(); super.setVisible(false); }
MenuElement[] subElements = new MenuElement[items.length];
ArrayList subElements = new ArrayList();
public MenuElement[] getSubElements() { Component[] items = getComponents(); MenuElement[] subElements = new MenuElement[items.length]; for (int i = 0; i < items.length; i++) subElements[i] = (MenuElement) items[i]; return subElements; }
subElements[i] = (MenuElement) items[i];
if (items[i] instanceof MenuElement) subElements.add(items[i]);
public MenuElement[] getSubElements() { Component[] items = getComponents(); MenuElement[] subElements = new MenuElement[items.length]; for (int i = 0; i < items.length; i++) subElements[i] = (MenuElement) items[i]; return subElements; }
return subElements;
return (MenuElement[]) subElements.toArray(new MenuElement[subElements.size()]);
public MenuElement[] getSubElements() { Component[] items = getComponents(); MenuElement[] subElements = new MenuElement[items.length]; for (int i = 0; i < items.length; i++) subElements[i] = (MenuElement) items[i]; return subElements; }
return "JPopupMenu";
StringBuffer sb = new StringBuffer(); sb.append(super.paramString()); sb.append(",label="); if (getLabel() != null) sb.append(getLabel()); sb.append(",lightWeightPopupEnabled=").append(isLightWeightPopupEnabled()); sb.append(",margin="); if (getMargin() != null) sb.append(margin); sb.append(",paintBorder=").append(isBo...
protected String paramString() { return "JPopupMenu"; }
firePropertyChange(LABEL_CHANGED_PROPERTY, oldLabel, label);
firePropertyChange("label", oldLabel, label);
public void setLabel(String label) { if (label != this.label) { String oldLabel = this.label; this.label = label; firePropertyChange(LABEL_CHANGED_PROPERTY, oldLabel, label); } }
firePropertyChange(VISIBLE_CHANGED_PROPERTY, old, (boolean) isVisible());
firePropertyChange("visible", old, isVisible());
public void setVisible(boolean visible) { boolean old = isVisible(); this.visible = visible; if (old != isVisible()) { firePropertyChange(VISIBLE_CHANGED_PROPERTY, old, (boolean) isVisible()); if (visible) { firePopupMenuWillBecomeVisible(); Container rootContainer = (Container) SwingUtilit...
"CheckBox.font", new FontUIResource("Dialog", Font.BOLD, 12),
"CheckBox.font", getControlTextFont(),
protected void initComponentDefaults(UIDefaults defaults) { super.initComponentDefaults(defaults); Object[] myDefaults = new Object[] { "Button.background", getControl(), "Button.border", MetalBorders.getButtonBorder(), "Button.darkShadow", getControlDarkShadow(), "Button.disabledText", get...
"CheckBoxMenuItem.font", new FontUIResource("Dialog", Font.BOLD, 12),
"CheckBoxMenuItem.font", getMenuTextFont(),
protected void initComponentDefaults(UIDefaults defaults) { super.initComponentDefaults(defaults); Object[] myDefaults = new Object[] { "Button.background", getControl(), "Button.border", MetalBorders.getButtonBorder(), "Button.darkShadow", getControlDarkShadow(), "Button.disabledText", get...
"ComboBox.font", new FontUIResource("Dialog", Font.BOLD, 12),
"ComboBox.font", getControlTextFont(),
protected void initComponentDefaults(UIDefaults defaults) { super.initComponentDefaults(defaults); Object[] myDefaults = new Object[] { "Button.background", getControl(), "Button.border", MetalBorders.getButtonBorder(), "Button.darkShadow", getControlDarkShadow(), "Button.disabledText", get...
"EditorPane.font", new FontUIResource("Dialog", Font.BOLD, 12),
"EditorPane.font", getControlTextFont(),
protected void initComponentDefaults(UIDefaults defaults) { super.initComponentDefaults(defaults); Object[] myDefaults = new Object[] { "Button.background", getControl(), "Button.border", MetalBorders.getButtonBorder(), "Button.darkShadow", getControlDarkShadow(), "Button.disabledText", get...
"Menu.font", getControlTextFont(),
"Menu.font", getMenuTextFont(),
protected void initComponentDefaults(UIDefaults defaults) { super.initComponentDefaults(defaults); Object[] myDefaults = new Object[] { "Button.background", getControl(), "Button.border", MetalBorders.getButtonBorder(), "Button.darkShadow", getControlDarkShadow(), "Button.disabledText", get...
"MenuBar.font", getControlTextFont(),
"MenuBar.font", getMenuTextFont(),
protected void initComponentDefaults(UIDefaults defaults) { super.initComponentDefaults(defaults); Object[] myDefaults = new Object[] { "Button.background", getControl(), "Button.border", MetalBorders.getButtonBorder(), "Button.darkShadow", getControlDarkShadow(), "Button.disabledText", get...
"MenuItem.font", getControlTextFont(),
"MenuItem.font", getMenuTextFont(),
protected void initComponentDefaults(UIDefaults defaults) { super.initComponentDefaults(defaults); Object[] myDefaults = new Object[] { "Button.background", getControl(), "Button.border", MetalBorders.getButtonBorder(), "Button.darkShadow", getControlDarkShadow(), "Button.disabledText", get...
"PopupMenu.font", new FontUIResource("Dialog", Font.BOLD, 12),
"PopupMenu.font", getMenuTextFont(),
protected void initComponentDefaults(UIDefaults defaults) { super.initComponentDefaults(defaults); Object[] myDefaults = new Object[] { "Button.background", getControl(), "Button.border", MetalBorders.getButtonBorder(), "Button.darkShadow", getControlDarkShadow(), "Button.disabledText", get...
"ProgressBar.font", new FontUIResource("Dialog", Font.BOLD, 12),
"ProgressBar.font", getControlTextFont(),
protected void initComponentDefaults(UIDefaults defaults) { super.initComponentDefaults(defaults); Object[] myDefaults = new Object[] { "Button.background", getControl(), "Button.border", MetalBorders.getButtonBorder(), "Button.darkShadow", getControlDarkShadow(), "Button.disabledText", get...
"RadioButtonMenuItem.font", MetalLookAndFeel.getControlTextFont(),
"RadioButtonMenuItem.font", getMenuTextFont(),
protected void initComponentDefaults(UIDefaults defaults) { super.initComponentDefaults(defaults); Object[] myDefaults = new Object[] { "Button.background", getControl(), "Button.border", MetalBorders.getButtonBorder(), "Button.darkShadow", getControlDarkShadow(), "Button.disabledText", get...
"Spinner.font", new FontUIResource("Dialog", Font.BOLD, 12),
"Spinner.font", getControlTextFont(),
protected void initComponentDefaults(UIDefaults defaults) { super.initComponentDefaults(defaults); Object[] myDefaults = new Object[] { "Button.background", getControl(), "Button.border", MetalBorders.getButtonBorder(), "Button.darkShadow", getControlDarkShadow(), "Button.disabledText", get...
"TabbedPane.font", new FontUIResource("Dialog", Font.BOLD, 12),
"TabbedPane.font", getControlTextFont(),
protected void initComponentDefaults(UIDefaults defaults) { super.initComponentDefaults(defaults); Object[] myDefaults = new Object[] { "Button.background", getControl(), "Button.border", MetalBorders.getButtonBorder(), "Button.darkShadow", getControlDarkShadow(), "Button.disabledText", get...
"TitledBorder.font", new FontUIResource("Dialog", Font.BOLD, 12),
"TitledBorder.font", getControlTextFont(),
protected void initComponentDefaults(UIDefaults defaults) { super.initComponentDefaults(defaults); Object[] myDefaults = new Object[] { "Button.background", getControl(), "Button.border", MetalBorders.getButtonBorder(), "Button.darkShadow", getControlDarkShadow(), "Button.disabledText", get...
"ToolBar.font", new FontUIResource("Dialog", Font.BOLD, 12),
"ToolBar.font", getMenuTextFont(),
protected void initComponentDefaults(UIDefaults defaults) { super.initComponentDefaults(defaults); Object[] myDefaults = new Object[] { "Button.background", getControl(), "Button.border", MetalBorders.getButtonBorder(), "Button.darkShadow", getControlDarkShadow(), "Button.disabledText", get...
if (result == null && element_parent != null)
if (result == null)
public Object getAttribute(Object key) { Object result = attributes.getAttribute(key); if (result == null && element_parent != null) { AttributeSet parentSet = element_parent.getAttributes(); if (parentSet != null) result = parentSet.getAttribute(key); } ...
AttributeSet parentSet = element_parent.getAttributes(); if (parentSet != null) result = parentSet.getAttribute(key);
AttributeSet resParent = getResolveParent(); if (resParent != null) result = resParent.getAttribute(key);
public Object getAttribute(Object key) { Object result = attributes.getAttribute(key); if (result == null && element_parent != null) { AttributeSet parentSet = element_parent.getAttributes(); if (parentSet != null) result = parentSet.getAttribute(key); } ...
if (attributes.getResolveParent() != null)
public AttributeSet getResolveParent() { if (attributes.getResolveParent() != null) return attributes.getResolveParent(); return element_parent.getAttributes(); }
return element_parent.getAttributes();
public AttributeSet getResolveParent() { if (attributes.getResolveParent() != null) return attributes.getResolveParent(); return element_parent.getAttributes(); }
UndoableEdit temp = content.remove(offset, length);
public void remove(int offset, int length) throws BadLocationException { DefaultDocumentEvent event = new DefaultDocumentEvent(offset, length, DocumentEvent.EventType.REMOVE); try { writeLock(); UndoableEdit temp = content.remove(offset, length); removeUpdate(event); post...
UndoableEdit temp = content.remove(offset, length);
public void remove(int offset, int length) throws BadLocationException { DefaultDocumentEvent event = new DefaultDocumentEvent(offset, length, DocumentEvent.EventType.REMOVE); try { writeLock(); UndoableEdit temp = content.remove(offset, length); removeUpdate(event); post...
indent = dealWithClosingGroupNodes(containedObj, outputstream, indent);
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString...
while (span > 0)
Row: while (span > 0)
protected int layoutRow(FlowView fv, int rowIndex, int pos) { View row = fv.getView(rowIndex); int axis = fv.getFlowAxis(); int span = fv.getFlowSpan(rowIndex); int x = fv.getFlowStart(rowIndex); int offset = pos; View logicalView = getLogicalView(fv); // Special case when span...
int breakWeight = view.getBreakWeight(axis, x, span); if (breakWeight >= View.ForcedBreakWeight) break;
offset += (view.getEndOffset() - view.getStartOffset());
protected int layoutRow(FlowView fv, int rowIndex, int pos) { View row = fv.getView(rowIndex); int axis = fv.getFlowAxis(); int span = fv.getFlowSpan(rowIndex); int x = fv.getFlowStart(rowIndex); int offset = pos; View logicalView = getLogicalView(fv); // Special case when span...
offset += (view.getEndOffset() - view.getStartOffset()); } if (span < 0)
if (span < 0 || breakWeight >= View.ForcedBreakWeight)
protected int layoutRow(FlowView fv, int rowIndex, int pos) { View row = fv.getView(rowIndex); int axis = fv.getFlowAxis(); int span = fv.getFlowSpan(rowIndex); int x = fv.getFlowStart(rowIndex); int offset = pos; View logicalView = getLogicalView(fv); // Special case when span...
offset = -1;
offset = - 1; break Row;
protected int layoutRow(FlowView fv, int rowIndex, int pos) { View row = fv.getView(rowIndex); int axis = fv.getFlowAxis(); int span = fv.getFlowSpan(rowIndex); int x = fv.getFlowStart(rowIndex); int offset = pos; View logicalView = getLogicalView(fv); // Special case when span...
return offset != pos ? offset : -1;
} return offset != pos ? offset : - 1;
protected int layoutRow(FlowView fv, int rowIndex, int pos) { View row = fv.getView(rowIndex); int axis = fv.getFlowAxis(); int span = fv.getFlowSpan(rowIndex); int x = fv.getFlowStart(rowIndex); int offset = pos; View logicalView = getLogicalView(fv); // Special case when span...
SizeRequirements res = super.calculateMinorAxisRequirements(axis, r);
SizeRequirements res = r; if (res == null) res = new SizeRequirements();
protected SizeRequirements calculateMinorAxisRequirements(int axis, SizeRequirements r) { // We need to call super here so that the alignment is properly // calculated. SizeRequirements res = super.calculateMinorAxisRequirements(axis, r); res.min...
res.preferred = (int) layoutPool.getPreferredSpan(axis); res.maximum = (int) layoutPool.getMaximumSpan(axis);
res.preferred = Math.max(res.minimum, (int) layoutPool.getMinimumSpan(axis)); res.maximum = Integer.MAX_VALUE; res.alignment = 0.5F;
protected SizeRequirements calculateMinorAxisRequirements(int axis, SizeRequirements r) { // We need to call super here so that the alignment is properly // calculated. SizeRequirements res = super.calculateMinorAxisRequirements(axis, r); res.min...
layoutPool.changedUpdate(changes, a, vf);
public void changedUpdate(DocumentEvent changes, Shape a, ViewFactory vf) { strategy.changedUpdate(this, changes, getInsideAllocation(a)); layoutDirty = true; }
layoutPool.removeUpdate(changes, a, vf);
public void removeUpdate(DocumentEvent changes, Shape a, ViewFactory vf) { strategy.removeUpdate(this, changes, getInsideAllocation(a)); layoutDirty = true; }
if (index < chars.length)
char ch = 0; if (index < chars.length && ((ch = chars[index]) != 'f' && ch != 'F' && ch != 'd' && ch != 'D'))
private double parseExponent(double value) throws NumberFormatException { if (index >= chars.length) return value; switch (chars[index]) { case 'e': case 'E': index++; break; default: throw new NumberFormatException(); } in...
return currencySymbol == null ? getCurrencyCode() : currencySymbol;
return getSymbol(Locale.getDefault());
public String getSymbol() { return currencySymbol == null ? getCurrencyCode() : currencySymbol; }
if (e.getKeyCode() == KeyEvent.VK_DOWN)
if (e.getKeyCode() == KeyEvent.VK_DOWN || e.getKeyCode() == KeyEvent.VK_KP_DOWN)
public void keyPressed(KeyEvent e) { TreePath start = BasicTreeUI.this.tree.getLeadSelectionPath(); DefaultMutableTreeNode last = null; if (start != null) last = (DefaultMutableTreeNode) start.getLastPathComponent(); if (last != null) { if (e.get...
BasicTreeUI.this.selectPath(BasicTreeUI.this.tree, new TreePath(next.getPath()));
{ TreePath newPath = new TreePath(next.getPath()); BasicTreeUI.this.selectPath(BasicTreeUI.this.tree, newPath); if (e.isControlDown()) tree.setLeadSelectionPath(newPath); else if (!next.isLeaf() && e.isShiftDown()) { BasicTreeUI.this.tree.expandPath(newPath); BasicTreeUI.this.tree.fireTreeExpanded(newPath); } }
public void keyPressed(KeyEvent e) { TreePath start = BasicTreeUI.this.tree.getLeadSelectionPath(); DefaultMutableTreeNode last = null; if (start != null) last = (DefaultMutableTreeNode) start.getLastPathComponent(); if (last != null) { if (e.get...
else if (e.getKeyCode() == KeyEvent.VK_UP)
else if (e.getKeyCode() == KeyEvent.VK_UP || e.getKeyCode() == KeyEvent.VK_KP_UP)
public void keyPressed(KeyEvent e) { TreePath start = BasicTreeUI.this.tree.getLeadSelectionPath(); DefaultMutableTreeNode last = null; if (start != null) last = (DefaultMutableTreeNode) start.getLastPathComponent(); if (last != null) { if (e.get...
else if (e.getKeyCode() == KeyEvent.VK_LEFT)
} else if (e.getKeyCode() == KeyEvent.VK_LEFT || e.getKeyCode() == KeyEvent.VK_KP_LEFT)
public void keyPressed(KeyEvent e) { TreePath start = BasicTreeUI.this.tree.getLeadSelectionPath(); DefaultMutableTreeNode last = null; if (start != null) last = (DefaultMutableTreeNode) start.getLastPathComponent(); if (last != null) { if (e.get...
else if (e.getKeyCode() == KeyEvent.VK_RIGHT)
else if (e.getKeyCode() == KeyEvent.VK_RIGHT || e.getKeyCode() == KeyEvent.VK_KP_RIGHT)
public void keyPressed(KeyEvent e) { TreePath start = BasicTreeUI.this.tree.getLeadSelectionPath(); DefaultMutableTreeNode last = null; if (start != null) last = (DefaultMutableTreeNode) start.getLastPathComponent(); if (last != null) { if (e.get...
else { DefaultMutableTreeNode next = (DefaultMutableTreeNode) BasicTreeUI.this.getNextVisibleNode(last); if (next != null) BasicTreeUI.this.selectPath(BasicTreeUI.this.tree, new TreePath(next.getPath())); } } else if (e.getKeyCode() == KeyEvent.VK_ENTER) { TreePath path = new TreePath(last.getPath()); if (!last.isLea...
public void keyPressed(KeyEvent e) { TreePath start = BasicTreeUI.this.tree.getLeadSelectionPath(); DefaultMutableTreeNode last = null; if (start != null) last = (DefaultMutableTreeNode) start.getLastPathComponent(); if (last != null) { if (e.get...
int row = ((int) click.getY() / getRowHeight()) - 1; TreePath path = BasicTreeUI.this.tree.getPathForRow(row);
int row = Math.round(click.y / BasicTreeUI.this.getRowHeight()); TreePath path = BasicTreeUI.this.getClosestPathForLocation(tree, click.x, click.y);
public void mouseClicked(MouseEvent e) { Point click = e.getPoint(); int row = ((int) click.getY() / getRowHeight()) - 1; TreePath path = BasicTreeUI.this.tree.getPathForRow(row); if (path == null) { // nothing should be selected if user clicks outside of tree BasicT...
if (path == null)
if (path != null)
public void mouseClicked(MouseEvent e) { Point click = e.getPoint(); int row = ((int) click.getY() / getRowHeight()) - 1; TreePath path = BasicTreeUI.this.tree.getPathForRow(row); if (path == null) { // nothing should be selected if user clicks outside of tree BasicT...
BasicTreeUI.this.tree.getSelectionModel().clearSelection(); BasicTreeUI.this.tree.repaint(); } else if (BasicTreeUI.this.tree.isVisible(path))
boolean inBounds = false; boolean cntlClick = false; Rectangle bounds = BasicTreeUI.this.getPathBounds( BasicTreeUI.this.tree, path); bounds.x -= rightChildIndent - 4; bounds.width += rightChildIndent + 4; if (bounds.contains(click.x, click.y)) inBounds = true; else if (BasicTreeUI.this.hasControlIcons() && (click.x ...
public void mouseClicked(MouseEvent e) { Point click = e.getPoint(); int row = ((int) click.getY() / getRowHeight()) - 1; TreePath path = BasicTreeUI.this.tree.getPathForRow(row); if (path == null) { // nothing should be selected if user clicks outside of tree BasicT...
if (!BasicTreeUI.this.isLeaf(row)) clickCount++;
lastClicked = cell; clickCount = 1; } }
public void mouseClicked(MouseEvent e) { Point click = e.getPoint(); int row = ((int) click.getY() / getRowHeight()) - 1; TreePath path = BasicTreeUI.this.tree.getPathForRow(row); if (path == null) { // nothing should be selected if user clicks outside of tree BasicT...