rem stringlengths 0 477k | add stringlengths 0 313k | context stringlengths 6 599k |
|---|---|---|
startOffset = -1; endOffset = -1; | public BranchElement(Element parent, AttributeSet attributes) { super(parent, attributes); } | |
int end = 0; if (getElementCount() == 0) end = getLength(); | if (children.length == 0) { if (endOffset == -1) throw new NullPointerException("BranchElement has no children."); } | public int getEndOffset() { int end = 0; if (getElementCount() == 0) end = getLength(); // FIXME: That ain't correct, fix it. else end = children[children.length - 1].getEndOffset(); return end; } |
end = children[children.length - 1].getEndOffset(); return end; | endOffset = children[children.length - 1].getEndOffset(); return endOffset; | public int getEndOffset() { int end = 0; if (getElementCount() == 0) end = getLength(); // FIXME: That ain't correct, fix it. else end = children[children.length - 1].getEndOffset(); return end; } |
int start = 0; if (getElementCount() == 0) start = 0; | if (children.length == 0) { if (startOffset == -1) throw new NullPointerException("BranchElement has no children."); } | public int getStartOffset() { int start = 0; if (getElementCount() == 0) start = 0; // FIXME: That ain't correct, fix it. else start = children[0].getStartOffset(); return start; } |
start = children[0].getStartOffset(); return start; | startOffset = children[0].getStartOffset(); return startOffset; | public int getStartOffset() { int start = 0; if (getElementCount() == 0) start = 0; // FIXME: That ain't correct, fix it. else start = children[0].getStartOffset(); return start; } |
{ | int len = content.length(); startDelta = 0; if (start > len) startDelta = start - len; endDelta = 0; if (end > len) endDelta = end - len; | public LeafElement(Element parent, AttributeSet attributes, int start, int end) { super(parent, attributes); { try { if (parent != null) { startPos = parent.getDocument().createPosition(start); endPos = parent.getDocument().createPosition(end); } else { st... |
if (parent != null) { startPos = parent.getDocument().createPosition(start); endPos = parent.getDocument().createPosition(end); } else { startPos = createPosition(start); endPos = createPosition(end); } | startPos = createPosition(start - startDelta); endPos = createPosition(end - endDelta); | public LeafElement(Element parent, AttributeSet attributes, int start, int end) { super(parent, attributes); { try { if (parent != null) { startPos = parent.getDocument().createPosition(start); endPos = parent.getDocument().createPosition(end); } else { st... |
} | public LeafElement(Element parent, AttributeSet attributes, int start, int end) { super(parent, attributes); { try { if (parent != null) { startPos = parent.getDocument().createPosition(start); endPos = parent.getDocument().createPosition(end); } else { st... | |
return endPos.getOffset(); | return endPos.getOffset() + endDelta; | public int getEndOffset() { return endPos.getOffset(); } |
return startPos.getOffset(); | return startPos.getOffset() + startDelta; | public int getStartOffset() { return startPos.getOffset(); } |
String scrollModeProp = System.getProperty("gnu.javax.swing.JViewport.scrollMode", "BLIT"); int myScrollMode; if (scrollModeProp.equalsIgnoreCase("simple")) myScrollMode = SIMPLE_SCROLL_MODE; else if (scrollModeProp.equalsIgnoreCase("backingstore")) myScrollMode = BACKINGSTORE_SCROLL_MODE; else myScrollMode = BLIT_SCRO... | setScrollMode(defaultScrollMode); | public JViewport() { setOpaque(true); String scrollModeProp = System.getProperty("gnu.javax.swing.JViewport.scrollMode", "BLIT"); int myScrollMode; if (scrollModeProp.equalsIgnoreCase("simple")) myScrollMode = SIMPLE_SCROLL_MODE; else if (scrollModeProp.equalsIgnoreCa... |
bad.minor = Minor.ClassCast; | public static ServantLocator narrow(org.omg.CORBA.Object obj) { try { return (ServantLocator) obj; } catch (ClassCastException ex) { BAD_OPERATION bad = new BAD_OPERATION(); bad.initCause(ex); throw bad; } } | |
throw new MARSHAL(); | MARSHAL m = new MARSHAL("Inappropriate"); m.minor = Minor.Inappropriate; throw m; | public static ServantLocator read(InputStream input) { throw new MARSHAL(); } |
throw new MARSHAL(); | MARSHAL m = new MARSHAL("Inappropriate"); m.minor = Minor.Inappropriate; throw m; | public static void write(OutputStream output, ServantLocator value) { throw new MARSHAL(); } |
attribHash.put("datatype", new XMLAttribute(null, Constants.OBJECT_TYPE)); | attribHash.put("datatype", new XMLAttribute(null, Constants.STRING_TYPE)); | private void init() { classXDFNodeName = "parameter"; // order matters! these are in *reverse* order of their // occurence in the XDF DTD attribOrder.add(0,"noteList"); attribOrder.add(0,"valueList"); attribOrder.add(0,"units"); attribOrder.add(0,"datatype"); attribOrder.add(0,"paramIdRef"); ... |
public DoubleItem(int kind, int offsetToFP, Register lsb, Register msb, double value) { super(kind, offsetToFP, lsb, msb); this.value = value; | DoubleItem(ItemFactory factory) { super(factory); | public DoubleItem(int kind, int offsetToFP, Register lsb, Register msb, double value) { super(kind, offsetToFP, lsb, msb); this.value = value; } |
return createConst(getValue()); | return factory.createDConst(getValue()); | protected DoubleWordItem cloneConstant() { return createConst(getValue()); } |
setPropertiesFromAttributes(); | valid = false; | public LabelView(Element element) { super(element); setPropertiesFromAttributes(); } |
setPropertiesFromAttributes(); | valid = false; super.changedUpdate(e, a, vf); | public void changedUpdate(DocumentEvent e, Shape a, ViewFactory vf) { setPropertiesFromAttributes(); } |
if (! valid) setPropertiesFromAttributes(); | public Color getBackground() { return background; } | |
if (! valid) setPropertiesFromAttributes(); | public Font getFont() { return font; } | |
return getContainer().getGraphics().getFontMetrics(font); | if (! valid) setPropertiesFromAttributes(); Container c = getContainer(); FontMetrics fm; if (c != null) fm = c.getFontMetrics(font); else fm = Toolkit.getDefaultToolkit().getFontMetrics(font); return fm; | protected FontMetrics getFontMetrics() { return getContainer().getGraphics().getFontMetrics(font); } |
if (! valid) setPropertiesFromAttributes(); | public Color getForeground() { return foreground; } | |
if (! valid) setPropertiesFromAttributes(); | public boolean isStrikeThrough() { return strikeThrough; } | |
if (! valid) setPropertiesFromAttributes(); | public boolean isSubscript() { return subscript; } | |
if (! valid) setPropertiesFromAttributes(); | public boolean isSuperscript() { return superscript; } | |
if (! valid) setPropertiesFromAttributes(); | public boolean isUnderline() { return underline; } | |
Element el = getElement(); AttributeSet atts = el.getAttributes(); background = (Color) atts.getAttribute(StyleConstants.Background); foreground = StyleConstants.getForeground(atts); strikeThrough = StyleConstants.isStrikeThrough(atts); subscript = StyleConstants.isSubscript(atts); superscript = StyleConstants.isSu... | AttributeSet atts = getAttributes(); setStrikeThrough(StyleConstants.isStrikeThrough(atts)); setSubscript(StyleConstants.isSubscript(atts)); setSuperscript(StyleConstants.isSuperscript(atts)); setUnderline(StyleConstants.isUnderline(atts)); | protected void setPropertiesFromAttributes() { Element el = getElement(); AttributeSet atts = el.getAttributes(); // We cannot use StyleConstants.getBackground() here, because that returns // BLACK as default (when background == null). What we need is the // background setting of the text component in... |
String family = StyleConstants.getFontFamily(atts); int size = StyleConstants.getFontSize(atts); int style = Font.PLAIN; if (StyleConstants.isBold(atts)) style |= Font.BOLD; if (StyleConstants.isItalic(atts)) style |= Font.ITALIC; font = new Font(family, style, size); | Document d = getDocument(); if (d instanceof StyledDocument) { StyledDocument doc = (StyledDocument) d; font = doc.getFont(atts); if (atts.isDefined(StyleConstants.Background)) background = doc.getBackground(atts); else background = null; foreground = doc.getForeground(atts); } valid = true; | protected void setPropertiesFromAttributes() { Element el = getElement(); AttributeSet atts = el.getAttributes(); // We cannot use StyleConstants.getBackground() here, because that returns // BLACK as default (when background == null). What we need is the // background setting of the text component in... |
while (fLen-- > 0) { planes.setScreenFieldAttr(fPos++,ffw1); } | public final void restoreScreen() throws IOException { int which = 0; ScreenPlanes planes = screen52.planes; try { log.debug("Restore "); bk.getNextByte(); bk.getNextByte(); int rows = bk.getNextByte() & 0xff; int cols = bk.getNextByte() & 0xff; int pos = bk.getNextByte() << 8 & 0xff00; pos |= bk.... | |
float span = 0; | public float getPreferredSpan(int axis) { if (axis != X_AXIS && axis != Y_AXIS) throw new IllegalArgumentException(); // make sure we have the metrics updateMetrics(); float span = 0; Element el = getElement(); switch (axis) { case X_AXIS: span = determineMaxLineLength(); ... | |
int line = getElement().getElementIndex(changes.getOffset()); | int line = el.getElementIndex(changes.getOffset()); if (changes.getType() == DocumentEvent.EventType.REMOVE && el.getElement(line) == longestLine) { maxLineLength = -1; if (determineMaxLineLength() != alloc.width) preferenceChanged(this, true, false); } | protected void updateDamage(DocumentEvent changes, Shape a, ViewFactory f) { Element el = getElement(); ElementChange ec = changes.getChange(el); // If ec is null then no lines were added or removed, just // repaint the changed line if (ec == null) { int line = getElement().getElement... |
determineMaxLineLength(); | if (determineMaxLineLength() != alloc.width) preferenceChanged(this, true, removed.length != newElements.length); | protected void updateDamage(DocumentEvent changes, Shape a, ViewFactory f) { Element el = getElement(); ElementChange ec = changes.getChange(el); // If ec is null then no lines were added or removed, just // repaint the changed line if (ec == null) { int line = getElement().getElement... |
boolean widthChanged = oldMaxLineLength != maxLineLength; boolean heightChanged = removed.length != newElements.length; if (widthChanged || heightChanged) preferenceChanged(this, widthChanged, heightChanged); | protected void updateDamage(DocumentEvent changes, Shape a, ViewFactory f) { Element el = getElement(); ElementChange ec = changes.getChange(el); // If ec is null then no lines were added or removed, just // repaint the changed line if (ec == null) { int line = getElement().getElement... | |
int lineClicked = (int) (y - rec.y) / metrics.getHeight(); if (lineClicked >= root.getElementCount()) return getEndOffset() - 1; | int lineClicked = Math.min(Math.max((int) (y - rec.y) / metrics.getHeight(), 0), root.getElementCount() - 1); | public int viewToModel(float x, float y, Shape a, Position.Bias[] b) { Rectangle rec = a.getBounds(); Document doc = getDocument(); Element root = doc.getDefaultRootElement(); // PlainView doesn't support line-wrapping so we can find out which // Element was clicked on just by the y-position ... |
if (SwingUtilities.isRightMouseButton(e)) { return; } | private void jbInit() throws Exception { this.setLayout(borderLayout1);// this.setOpaque(false);// setDoubleBuffered(true); s.setOpaque(false); s.setDoubleBuffered(false); session.setGUI((SessionGUI)this);// screen = new Screen5250(this,sesConfig); screen = session.getScreen()... | |
if (SwingUtilities.isRightMouseButton(e)) { return; } | public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2 & doubleClick) { screen.sendKeys("[enter]"); } else { int pos = bi.getPosFromView(e.getX(), e.getY()); if (log.isDebugEnabled()) { log.d... | |
cancelEditing(tree); | completeEditing(false, false, false); | public void editingCanceled(ChangeEvent e) { cancelEditing(tree); } |
stopEditing(tree); | completeEditing(false, false, true); | public void editingStopped(ChangeEvent e) { stopEditing(tree); } |
throws NotImplementedException | public void keyPressed(KeyEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? } | |
throws NotImplementedException | public void keyReleased(KeyEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? } | |
throws NotImplementedException | public void keyTyped(KeyEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? } | |
char typed = Character.toLowerCase(e.getKeyChar()); for (int row = tree.getLeadSelectionRow() + 1; row < tree.getRowCount(); row++) { if (checkMatch(row, typed)) { tree.setSelectionRow(row); tree.scrollRowToVisible(row); return; } } for (int row = 0; row < tree.getLeadSelectionRow(); row++) { if (checkMatch(row, type... | public void keyTyped(KeyEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? } | |
throws NotImplementedException | public void mouseDragged(MouseEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? } | |
throws NotImplementedException | public void mouseMoved(MouseEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? } | |
if (tree != null && tree.isEnabled()) | if (! e.isConsumed()) { handleEvent(e); selectedOnPress = true; } else | public void mousePressed(MouseEvent e) { if (tree != null && tree.isEnabled()) { // Maybe stop editing and return. if (isEditing(tree) && tree.getInvokesStopCellEditing() && !stopEditing(tree)) return; int x = e.getX(); int y = e.getY(... |
if (isEditing(tree) && tree.getInvokesStopCellEditing() && !stopEditing(tree)) return; int x = e.getX(); int y = e.getY(); TreePath path = getClosestPathForLocation(tree, x, y); if (path != null) { Rectangle bounds = getPathBounds(tree, path); if (SwingUtilities.isLeftMouseButton(e)) checkForClickInExpandControl(path... | selectedOnPress = false; | public void mousePressed(MouseEvent e) { if (tree != null && tree.isEnabled()) { // Maybe stop editing and return. if (isEditing(tree) && tree.getInvokesStopCellEditing() && !stopEditing(tree)) return; int x = e.getX(); int y = e.getY(... |
throws NotImplementedException | public void mouseReleased(MouseEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? } | |
if (! e.isConsumed() && ! selectedOnPress) handleEvent(e); | public void mouseReleased(MouseEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? } | |
source.addMouseListener(this); source.addMouseMotionListener(this); dispatch(e); | public MouseInputHandler(Component source, Component destination, MouseEvent e) { this.source = source; this.destination = destination; } | |
throws NotImplementedException | public void mouseClicked(MouseEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? } | |
dispatch(e); | public void mouseClicked(MouseEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? } | |
dispatch(e); | public void mouseDragged(MouseEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? } | |
throws NotImplementedException | public void mouseEntered(MouseEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? } | |
if (! SwingUtilities.isLeftMouseButton(e)) removeFromSource(); | public void mouseEntered(MouseEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? } | |
throws NotImplementedException | public void mouseExited(MouseEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? } | |
if (! SwingUtilities.isLeftMouseButton(e)) removeFromSource(); | public void mouseExited(MouseEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? } | |
removeFromSource(); | public void mouseMoved(MouseEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? } | |
throws NotImplementedException | public void mousePressed(MouseEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? } | |
dispatch(e); removeFromSource(); | public void mouseReleased(MouseEvent e) throws NotImplementedException { // TODO: What should be done here, if anything? } | |
throws NotImplementedException | protected void removeFromSource() throws NotImplementedException { // TODO: Implement this properly. } | |
if (source != null) { source.removeMouseListener(this); source.removeMouseMotionListener(this); } source = null; destination = null; | protected void removeFromSource() throws NotImplementedException { // TODO: Implement this properly. } | |
if (size == null || cell == null) return null; String s = cell.toString(); Font f = tree.getFont(); FontMetrics fm = tree.getToolkit().getFontMetrics(f); if (s != null) | Dimension prefSize; if (editingComponent != null && editingRow == row) | public Rectangle getNodeDimensions(Object cell, int row, int depth, boolean expanded, Rectangle size) { if (size == null || cell == null) return null; String s = cell.toString(); Font f = tree.getFont(); FontMetrics fm = tree.getToolkit().getFontMetr... |
TreePath path = treeState.getPathForRow(row); | prefSize = editingComponent.getPreferredSize(); int rowHeight = getRowHeight(); if (rowHeight > 0 && rowHeight != prefSize.height) prefSize.height = rowHeight; } else { Component rend = currentCellRenderer.getTreeCellRendererComponent(tree, cell, tree.isRowSelected(row), expanded, treeModel.isLeaf(cell), row, false); ... | public Rectangle getNodeDimensions(Object cell, int row, int depth, boolean expanded, Rectangle size) { if (size == null || cell == null) return null; String s = cell.toString(); Font f = tree.getFont(); FontMetrics fm = tree.getToolkit().getFontMetr... |
size.width = SwingUtilities.computeStringWidth(fm, s); size.width = size.width + getCurrentControlIcon(path).getIconWidth() + gap + getNodeIcon(path).getIconWidth(); size.height = getMaxHeight(tree); size.y = size.height * row; | size.y = prefSize.height * row; size.width = prefSize.width; size.height = prefSize.height; | public Rectangle getNodeDimensions(Object cell, int row, int depth, boolean expanded, Rectangle size) { if (size == null || cell == null) return null; String s = cell.toString(); Font f = tree.getFont(); FontMetrics fm = tree.getToolkit().getFontMetr... |
else size = new Rectangle(getRowX(row, depth), prefSize.height * row, prefSize.width, prefSize.height); | public Rectangle getNodeDimensions(Object cell, int row, int depth, boolean expanded, Rectangle size) { if (size == null || cell == null) return null; String s = cell.toString(); Font f = tree.getFont(); FontMetrics fm = tree.getToolkit().getFontMetr... | |
else if (property.equals(JTree.EDITABLE_PROPERTY)) setEditable(((Boolean) event.getNewValue()).booleanValue()); | public void propertyChange(PropertyChangeEvent event) { String property = event.getPropertyName(); if (property.equals(JTree.ROOT_VISIBLE_PROPERTY)) { validCachedPreferredSize = false; treeState.setRootVisible(tree.isRootVisible()); tree.repaint(); } else i... | |
throws NotImplementedException | public void propertyChange(PropertyChangeEvent event) throws NotImplementedException { // TODO: What should be done here, if anything? } | |
treeSelectionModel.resetRowSelection(); | public void propertyChange(PropertyChangeEvent event) throws NotImplementedException { // TODO: What should be done here, if anything? } | |
completeEditing(); | public void treeCollapsed(TreeExpansionEvent event) { validCachedPreferredSize = false; treeState.setExpandedState(event.getPath(), false); // The maximal cell height may change maxHeight = 0; tree.revalidate(); tree.repaint(); } | |
tree.scrollPathToVisible(tree.getLeadSelectionPath()); | public void actionPerformed(ActionEvent e) { if (tree != null) { String command = (String) getValue(Action.NAME); if (command.equals("selectFirst")) { ensureRowsAreVisible(0, 0); tree.setSelectionInterval(0, 0); } if (command.... | |
tree.scrollPathToVisible(tree.getLeadSelectionPath()); | public void actionPerformed(ActionEvent e) { TreePath currentPath = tree.getLeadSelectionPath(); int currentRow; if (currentPath != null) currentRow = treeState.getRowForPath(currentPath); else currentRow = 0; int rows = treeState.getRowCount(); int nextRow = currentRo... | |
newVisible.y -= (visible.height - newVisible.height); | newVisible.y -= visible.height - newVisible.height; | public void actionPerformed(ActionEvent e) { String command = (String) getValue(Action.NAME); boolean extendSelection = command.equals("scrollUpExtendSelection") || command.equals("scrollDownExtendSelection"); boolean changeSelection = command.equals("scrollUpChangeS... |
if (tree.isEditing()) tree.cancelEditing(); | completeEditing(); | public void valueChanged(TreeSelectionEvent event) { if (tree.isEditing()) tree.cancelEditing(); TreePath op = event.getOldLeadSelectionPath(); TreePath np = event.getNewLeadSelectionPath(); // Repaint of the changed lead selection path. if (op != np) { Recta... |
tree.scrollPathToVisible(tree.getLeadSelectionPath()); | public void actionPerformed(ActionEvent e) { int selected = tree.getLeadSelectionRow(); if (selected != -1 && isLeaf(selected)) { TreePath anchorPath = tree.getAnchorSelectionPath(); TreePath leadPath = tree.getLeadSelectionPath(); toggleExpandState(getPathForRow(tree,... | |
tree.scrollPathToVisible(tree.getLeadSelectionPath()); | public void actionPerformed(ActionEvent e) { TreePath current = tree.getLeadSelectionPath(); if (current == null) return; String command = (String) getValue(Action.NAME); if (command.equals("selectParent")) { if (current == null) return; if (tree.isE... | |
completeEditing(false, false, false); finish(); | if (editingComponent != null) completeEditing(false, true, false); | public void cancelEditing(JTree tree) { // There is no need to send the cancel message to the editor, // as the cancellation event itself arrives from it. This would // only be necessary when cancelling the editing programatically. completeEditing(false, false, false); finish(); } |
if (tree.getInvokesStopCellEditing() && stopEditingInCompleteEditing && editingComponent != null) cellEditor.stopCellEditing(); | protected void completeEditing() { completeEditing(false, true, false); } | |
treeState = createLayoutCache(); | configureLayoutCache(); treeState.setRootVisible(tree.isRootVisible()); | protected void completeUIInstall() { setShowsRootHandles(tree.getShowsRootHandles()); updateRenderer(); updateDepthOffset(); setSelectionModel(tree.getSelectionModel()); treeState = createLayoutCache(); treeSelectionModel.setRowMapper(treeState); configureLayoutCache(); updateSize(); } |
configureLayoutCache(); | protected void completeUIInstall() { setShowsRootHandles(tree.getShowsRootHandles()); updateRenderer(); updateDepthOffset(); setSelectionModel(tree.getSelectionModel()); treeState = createLayoutCache(); treeSelectionModel.setRowMapper(treeState); configureLayoutCache(); updateSize(); } | |
action= new TreeAction(); | action = new TreeHomeAction(-1, "selectFirst"); | private ActionMap createDefaultActions() { ActionMapUIResource am = new ActionMapUIResource(); Action action; action= new TreeAction(); am.put(action.getValue(Action.NAME), action); // TreeHomeAction. action= new TreeHomeAction(-1, "selectFirst"); am.put(action.getValue(Action.NAME), action); ... |
action= new TreeHomeAction(-1, "selectFirst"); | action = new TreeHomeAction(-1, "selectFirstChangeLead"); | private ActionMap createDefaultActions() { ActionMapUIResource am = new ActionMapUIResource(); Action action; action= new TreeAction(); am.put(action.getValue(Action.NAME), action); // TreeHomeAction. action= new TreeHomeAction(-1, "selectFirst"); am.put(action.getValue(Action.NAME), action); ... |
action= new TreeHomeAction(-1, "selectFirstChangeLead"); | action = new TreeHomeAction(-1, "selectFirstExtendSelection"); | private ActionMap createDefaultActions() { ActionMapUIResource am = new ActionMapUIResource(); Action action; action= new TreeAction(); am.put(action.getValue(Action.NAME), action); // TreeHomeAction. action= new TreeHomeAction(-1, "selectFirst"); am.put(action.getValue(Action.NAME), action); ... |
action= new TreeHomeAction(-1, "selectFirstExtendSelection"); | action = new TreeHomeAction(1, "selectLast"); | private ActionMap createDefaultActions() { ActionMapUIResource am = new ActionMapUIResource(); Action action; action= new TreeAction(); am.put(action.getValue(Action.NAME), action); // TreeHomeAction. action= new TreeHomeAction(-1, "selectFirst"); am.put(action.getValue(Action.NAME), action); ... |
action= new TreeHomeAction(1, "selectLast"); | action = new TreeHomeAction(1, "selectLastChangeLead"); | private ActionMap createDefaultActions() { ActionMapUIResource am = new ActionMapUIResource(); Action action; action= new TreeAction(); am.put(action.getValue(Action.NAME), action); // TreeHomeAction. action= new TreeHomeAction(-1, "selectFirst"); am.put(action.getValue(Action.NAME), action); ... |
action= new TreeHomeAction(1, "selectLastChangeLead"); am.put(action.getValue(Action.NAME), action); action= new TreeHomeAction(1, "selectLastExtendSelection"); | action = new TreeHomeAction(1, "selectLastExtendSelection"); | private ActionMap createDefaultActions() { ActionMapUIResource am = new ActionMapUIResource(); Action action; action= new TreeAction(); am.put(action.getValue(Action.NAME), action); // TreeHomeAction. action= new TreeHomeAction(-1, "selectFirst"); am.put(action.getValue(Action.NAME), action); ... |
action = new TreeStartEditingAction("startEditing"); am.put(action.getValue(Action.NAME), action); action = new TreeCancelEditingAction("cancel"); am.put(action.getValue(Action.NAME), action); | private ActionMap createDefaultActions() { ActionMapUIResource am = new ActionMapUIResource(); Action action; action= new TreeAction(); am.put(action.getValue(Action.NAME), action); // TreeHomeAction. action= new TreeHomeAction(-1, "selectFirst"); am.put(action.getValue(Action.NAME), action); ... | |
return ((TreePath) parent.getLastPathComponent()); | return (TreePath) parent.getLastPathComponent(); | protected TreePath getLastChildPath(TreePath parent) { return ((TreePath) parent.getLastPathComponent()); } |
hashColor = UIManager.getColor("Tree.hash"); if (hashColor == null) hashColor = Color.black; | protected void installDefaults() { LookAndFeel.installColorsAndFont(tree, "Tree.background", "Tree.foreground", "Tree.font"); tree.setOpaque(true); rightChildIndent = UIManager.getInt("Tree.rightChildIndent"); leftChildIndent = UIManager.getInt("Tree.leftChildIndent");... | |
action = new TreeAction(); | protected void installKeyboardActions() { InputMap focusInputMap = (InputMap) SharedUIDefaults.get("Tree.focusInputMap"); SwingUtilities.replaceUIInputMap(tree, JComponent.WHEN_FOCUSED, focusInputMap); InputMap ancestorInputMap = (InputMap) SharedUIDefaults.get(... | |
int width = 8; | int width; | protected boolean isLocationInExpandControl(TreePath path, int mouseX, int mouseY) { boolean cntlClick = false; if (! treeModel.isLeaf(path.getLastPathComponent())) { int width = 8; // Only guessing. Icon expandedIcon = getExpandedIcon(); i... |
int left = getRowX(tree.getRowForPath(path), path.getPathCount() - 1) -getRightChildIndent() - width / 2 + i.left; | int depth; if (isRootVisible()) depth = path.getPathCount()-1; else depth = path.getPathCount()-2; int left = getRowX(tree.getRowForPath(path), depth) - width + i.left; | protected boolean isLocationInExpandControl(TreePath path, int mouseX, int mouseY) { boolean cntlClick = false; if (! treeModel.isLeaf(path.getLastPathComponent())) { int width = 8; // Only guessing. Icon expandedIcon = getExpandedIcon(); i... |
if (parent != null) | boolean paintLine; if (isRootVisible()) paintLine = parent != null; else paintLine = parent != null && parent.getPathCount() > 1; if (paintLine) | protected void paintVerticalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, TreePath path) { Rectangle bounds = getPathBounds(tree, path); TreePath parent = path.getParentPath(); if (parent != null) { Rectangle parentBounds = getPathBounds(tr... |
stopEditingInCompleteEditing = true; | protected void prepareForUIInstall() { lastSelectedRow = -1; preferredSize = new Dimension(); largeModel = tree.isLargeModel(); preferredSize = new Dimension(); setModel(tree.getModel()); } | |
cellEditor = editor; createdCellEditor = true; | updateCellEditor(); | protected void setCellEditor(TreeCellEditor editor) { cellEditor = editor; createdCellEditor = true; } |
currentCellRenderer = tcr; | completeEditing(); | protected void setCellRenderer(TreeCellRenderer tcr) { currentCellRenderer = tcr; updateRenderer(); } |
if (treeState != null) { treeState.invalidateSizes(); updateSize(); } | protected void setCellRenderer(TreeCellRenderer tcr) { currentCellRenderer = tcr; updateRenderer(); } | |
tree.setEditable(newValue); | updateCellEditor(); | protected void setEditable(boolean newValue) { tree.setEditable(newValue); } |
completeEditing(); | protected void setLargeModel(boolean largeModel) { if (largeModel != this.largeModel) { tree.removeComponentListener(componentListener); this.largeModel = largeModel; tree.addComponentListener(componentListener); } } | |
completeEditing(); | protected void setRootVisible(boolean newValue) { tree.setRootVisible(newValue); } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.