rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
pane.dialog.setVisible(false); }
public void actionPerformed(ActionEvent a) { System.out.println("ACTION ---> " + a); // pane.dialog.dispose(); if (pane.dialog.isModal()) { System.out.println("modal dialog !!"); pane.dialog.setModal(false); } pane.dialog.setVisible(false); }
inlineList.add(new TextContent("before", parentElement, textContent.toString()));
inlineList.add(new TextContent("before", parentElement, textContent.toString(), true));
static List getChildContentList(LayoutContext c, Content parent) { List inlineList = new ArrayList(); FirstLineStyle firstLineStyle = null; FirstLetterStyle firstLetterStyle = null; StringBuffer textContent = null; CascadedStyle parentStyle = parent.getStyle(); Element pare...
inlineList.add(new TextContent(parentElement, textContent.toString()));
inlineList.add(new TextContent("after", parentElement, textContent.toString(), true));
static List getChildContentList(LayoutContext c, Content parent) { List inlineList = new ArrayList(); FirstLineStyle firstLineStyle = null; FirstLetterStyle firstLetterStyle = null; StringBuffer textContent = null; CascadedStyle parentStyle = parent.getStyle(); Element pare...
return false; return getFileFilter().accept(f);
return true; FileFilter ff = getFileFilter(); if (ff != null) return ff.accept(f); else return true;
public boolean accept(File f) { if (f == null) return false; return getFileFilter().accept(f); }
firePropertyChange(CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY, old, newFilters);
firePropertyChange(CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY, old, newFilters); } setFileFilter(filter);
public void addChoosableFileFilter(FileFilter filter) { FileFilter[] old = getChoosableFileFilters(); choosableFilters.add(filter); FileFilter[] newFilters = getChoosableFileFilters(); firePropertyChange(CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY, old, newFilters); }
if (fsv.getParentDirectory(currentDir) != null)
public void changeToParentDirectory() { if (fsv.getParentDirectory(currentDir) != null) setCurrentDirectory(fsv.getParentDirectory(currentDir)); }
return null;
return new File[0];
public File[] getSelectedFiles() { if (selectedFiles != null) return selectedFiles; if (selectedFile != null) return new File[] { selectedFile }; return null; }
if (f == currentFilter) setFileFilter(null);
public boolean removeChoosableFileFilter(FileFilter f) { FileFilter[] old = getChoosableFileFilters(); if (! choosableFilters.remove(f)) return false; FileFilter[] newFilters = getChoosableFileFilters(); firePropertyChange(CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY, old, newFilters); return true; }
if (b) addChoosableFileFilter(getAcceptAllFileFilter()); else removeChoosableFileFilter(getAcceptAllFileFilter());
public void setAcceptAllFileFilterUsed(boolean b) { if (isAcceptAll != b) { isAcceptAll = b; firePropertyChange(ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY, ! isAcceptAll, isAcceptAll); } }
if (filter != null && !choosableFilters.contains(filter)) addChoosableFileFilter(filter);
public void setFileFilter(FileFilter filter) { if (currentFilter != filter) { FileFilter old = currentFilter; currentFilter = filter; firePropertyChange(FILE_FILTER_CHANGED_PROPERTY, old, currentFilter); } }
if (selectedFile != file)
if (selectedFile == null || !selectedFile.equals(file))
public void setSelectedFile(File file) { if (selectedFile != file) { File old = selectedFile; selectedFile = file; firePropertyChange(SELECTED_FILE_CHANGED_PROPERTY, old, selectedFile); } }
if (selectedFiles != null) setSelectedFile(selectedFiles[0]);
public void setSelectedFiles(File[] selectedFiles) { if (this.selectedFiles != selectedFiles) { File[] old = this.selectedFiles; this.selectedFiles = selectedFiles; firePropertyChange(SELECTED_FILES_CHANGED_PROPERTY, old, selectedFiles); } if (selectedFiles != null) setSelectedFile(selectedFiles...
this.size = size; this.pointSize = (float) size;
public Font (String name, int style, int size) { HashMap attrs = new HashMap(); ClasspathFontPeer.copyStyleToAttrs (style, attrs); ClasspathFontPeer.copySizeToAttrs (size, attrs); this.peer = getPeerFromToolkit (name, attrs); }
equals(Object obj)
public boolean equals(Object obj)
equals(Object obj){ if (obj == null) return(false); if (!(obj instanceof Font)) return(false); Font f = (Font)obj; return (f.getName ().equals (this.getName ()) && f.getFamily ().equals (this.getFamily ()) && f.getFontName ().equals (this.getFontName ()) && f.getTransform ().equals ...
return(false);
return false;
equals(Object obj){ if (obj == null) return(false); if (!(obj instanceof Font)) return(false); Font f = (Font)obj; return (f.getName ().equals (this.getName ()) && f.getFamily ().equals (this.getFamily ()) && f.getFontName ().equals (this.getFontName ()) && f.getTransform ().equals ...
protected static Font getFontFromToolkit (String name, Map attribs)
static Font getFontFromToolkit(String name, Map attribs)
protected static Font getFontFromToolkit (String name, Map attribs) { return tk ().getFont (name, attribs); }
protected static ClasspathFontPeer getPeerFromToolkit (String name, Map attrs)
static ClasspathFontPeer getPeerFromToolkit(String name, Map attrs)
protected static ClasspathFontPeer getPeerFromToolkit (String name, Map attrs) { return tk ().getClasspathFontPeer (name, attrs); }
return (int) peer.getSize (this);
return size;
public int getSize (){ return (int) peer.getSize (this);}
return peer.getSize (this);
return pointSize;
public float getSize2D (){ return peer.getSize (this);}
protected static ClasspathToolkit tk ()
static ClasspathToolkit tk()
protected static ClasspathToolkit tk () { return (ClasspathToolkit)(Toolkit.getDefaultToolkit ()); }
return (ClasspathToolkit)(Toolkit.getDefaultToolkit ());
return (ClasspathToolkit) Toolkit.getDefaultToolkit();
protected static ClasspathToolkit tk () { return (ClasspathToolkit)(Toolkit.getDefaultToolkit ()); }
toString()
public String toString()
toString(){ String styleString = ""; switch (getStyle ()) { case 0: styleString = "plain"; break; case 1: styleString = "bold"; break; case 2: styleString = "italic"; break; default: styleString = "unknown"; } return getClass ().getName () + "[family=" + getFa...
public ExtendedResponse createExtendedResponse(String id,
ExtendedResponse createExtendedResponse(String id,
public ExtendedResponse createExtendedResponse(String id, byte[] berValue, int offset, int length) throws NamingException;
threadPool.setMinimumPoolSize(10);
public synchronized void start() throws Exception { if (started) { return; } loadClientAOPConfig(); loadServerAOPConfig(); log.info(this + " starting"); mbeanServer = findMBeanServer(); JDBCPersistenceManager jpm = new JDBCPersistenceManager()...
/*
public static Font getFont( Context c, Node e ) { //u.p("testing node: " + e); //Font f = c.getGraphics().getFont(); // if plain text then get the styling from the parent node if ( e.getNodeType() == e.TEXT_NODE ) { //u.p("it's a node"); Element el = (Element)e.getP...
u.p( "big error in getFont(). Got a node that is neither txt nor element" ); return null;
*/ u.p("here"); u.p("big error in getFont(). Got a node that is neither txt nor element" ); u.p("probably returning a bad font!"); Font f = c.getGraphics().getFont(); return f;
public static Font getFont( Context c, Node e ) { //u.p("testing node: " + e); //Font f = c.getGraphics().getFont(); // if plain text then get the styling from the parent node if ( e.getNodeType() == e.TEXT_NODE ) { //u.p("it's a node"); Element el = (Element)e.getP...
Binding binding = createBinding(nodeId, queueName, condition, selector, channelId, true);
Selector filter = null; if (selector != null) { filter = new Selector(selector); } Binding binding = createBinding(nodeId, queueName, condition, filter, channelId, true);
protected List getBindings() throws Exception { Connection conn = null; PreparedStatement ps = null; ResultSet rs = null; TransactionWrapper wrap = new TransactionWrapper(); List list = new ArrayList(); try { conn = ds.getConnection(); ps = c...
ps.setString(5, binding.getSelector());
if (filterString != null) { ps.setString(5, filterString); } else { ps.setNull(5, Types.VARCHAR); }
protected void insertBinding(Binding binding) throws Exception { Connection conn = null; PreparedStatement ps = null; TransactionWrapper wrap = new TransactionWrapper(); try { conn = ds.getConnection(); ps = conn.prepareStatement(getSQLStatement("INSERT...
stripped.clear();
stripWhitespaceContent(stripped);
public static List stripInlineContent(Context c, List inlineContent) { List stripped = new LinkedList(); List pendingStylePushes = new LinkedList(); boolean collapse = false; for (Iterator i = inlineContent.iterator(); i.hasNext();) { Object o = i.next(); if (o inst...
invokeGC = new JLabel(gcIcon);
invokeGC = new JButton(gcIcon);
public MemoryDisplay() { super(); setLayout(new BorderLayout(5, 0)); panel = new MemoryPanel(); panel.setOpaque(false); invokeGC = new JLabel(gcIcon); invokeGC.setRequestFocusEnabled(false); invokeGC.setFocusable(false); setBorder(new EmptyBorder(1, 1, 1, 1)); invokeGC.setBorder(BorderFact...
invokeGC.addMouseListener(new MouseAdapter()
invokeGC.setUI(new BlueButtonUI()); invokeGC.addActionListener(new ActionListener()
public MemoryDisplay() { super(); setLayout(new BorderLayout(5, 0)); panel = new MemoryPanel(); panel.setOpaque(false); invokeGC = new JLabel(gcIcon); invokeGC.setRequestFocusEnabled(false); invokeGC.setFocusable(false); setBorder(new EmptyBorder(1, 1, 1, 1)); invokeGC.setBorder(BorderFact...
public void mouseClicked(MouseEvent e)
public void actionPerformed(ActionEvent e)
public MemoryDisplay() { super(); setLayout(new BorderLayout(5, 0)); panel = new MemoryPanel(); panel.setOpaque(false); invokeGC = new JLabel(gcIcon); invokeGC.setRequestFocusEnabled(false); invokeGC.setFocusable(false); setBorder(new EmptyBorder(1, 1, 1, 1)); invokeGC.setBorder(BorderFact...
executor, null);
executor);
public synchronized void startService() throws Exception { super.startService(); try { postOffice = serverPeer.getTopicPostOfficeInstance(); destination.setPostOffice(postOffice); // We deploy any queues corresponding to pre-existing durable subscrip...
public static FloatedBlockBox generateFloated( LayoutContext c, FloatedBlockContent content, int avail,
public static FloatLayoutResult generateFloated( final LayoutContext c, FloatedBlockContent content, int avail,
public static FloatedBlockBox generateFloated( LayoutContext c, FloatedBlockContent content, int avail, LineBox curr_line, List pendingFloats) { Rectangle oe = c.getExtents(); c.setExtents(new Rectangle(oe)); MarkerData markerData = c.getCurrentMarkerData(); ...
block.y = curr_line.y + content.getMarginFromPrevious();
if (pendingFloats != null) { block.y = curr_line.y + content.getMarginFromPrevious(); } else { block.y = curr_line.y + curr_line.height; } block.calcInitialCanvasLocation(c); int initialY = block.y;
public static FloatedBlockBox generateFloated( LayoutContext c, FloatedBlockContent content, int avail, LineBox curr_line, List pendingFloats) { Rectangle oe = c.getExtents(); c.setExtents(new Rectangle(oe)); MarkerData markerData = c.getCurrentMarkerData(); ...
if (! block.getStyle().isFloated()) { throw new XRRuntimeException("Invalid call to generateFloatedBlock(); where float: none ");
if (pendingFloats != null && (pendingFloats.size() > 0 || block.getWidth() > avail)) { block.detach(); result.setPending(true); result.setPendingContent(content); } else { if (c.isPrint()) { positionFloatOnPage(c, content, curr_line, block, initialY != block.y); } result.setBlock(block);
public static FloatedBlockBox generateFloated( LayoutContext c, FloatedBlockContent content, int avail, LineBox curr_line, List pendingFloats) { Rectangle oe = c.getExtents(); c.setExtents(new Rectangle(oe)); MarkerData markerData = c.getCurrentMarkerData(); ...
if (pendingFloats.size() > 0 || block.getWidth() > avail) { if (pendingFloats.size() > 0) { block.y = 0; } pendingFloats.add(block); c.getBlockFormattingContext().getFloatManager().removeFloat(block); c.getLayer().removeFloat(block); block.setPending(true); } return block;
return result;
public static FloatedBlockBox generateFloated( LayoutContext c, FloatedBlockContent content, int avail, LineBox curr_line, List pendingFloats) { Rectangle oe = c.getExtents(); c.setExtents(new Rectangle(oe)); MarkerData markerData = c.getCurrentMarkerData(); ...
MessageIdGeneratorFactory.instance.getGenerator(serverID, connectionDelegate);
MessageIdGeneratorFactory.instance.getGenerator(serverID, cfd);
public Object handleCreateConnectionDelegate(Invocation inv) throws Throwable { ClientConnectionFactoryDelegate cfd = (ClientConnectionFactoryDelegate)inv.getTargetObject(); ClientConnectionDelegate connectionDelegate = (ClientConnectionDelegate)inv.invokeNext(); connectionDelegate.init(); Stri...
assertEquals(Long.MAX_VALUE, queueConsumer.receive().getJMSExpiration());
assertEquals(0, queueConsumer.receive().getJMSExpiration());
public void testZeroExpiration() throws Exception { Message m = queueProducerSession.createMessage(); queueProducer.send(m); assertEquals(Long.MAX_VALUE, queueConsumer.receive().getJMSExpiration()); }
size.width = size.width + getCurrentControlIcon(null).getIconWidth() + gap;
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...
if (row == 0) return 0;
protected int getRowX(int row, int depth) { if (row == 0) return 0; return depth * rightChildIndent; }
treeState.setRootVisible(tree.isRootVisible());
public void propertyChange(PropertyChangeEvent event) { if ((event.getPropertyName()).equals("rootVisible")) { validCachedPreferredSize = false; tree.repaint(); } }
if (e.getActionCommand().equals("selectPreviousChangeLead") || e.getActionCommand().equals("selectPreviousExtendSelection") || e.getActionCommand().equals("selectPrevious") || e.getActionCommand().equals("selectNext") || e.getActionCommand().equals("selectNextExtendSelection") || e.getActionCommand().equals("selectNext...
if (command.equals("selectPreviousChangeLead") || command.equals("selectPreviousExtendSelection") || command.equals("selectPrevious") || command.equals("selectNext") || command.equals("selectNextExtendSelection") || command.equals("selectNextChangeLead"))
public void actionPerformed(ActionEvent e) { TreePath lead = tree.getLeadSelectionPath(); if (e.getActionCommand().equals("selectPreviousChangeLead") || e.getActionCommand().equals("selectPreviousExtendSelection") || e.getActionCommand().equals("selectPrevious") || e.getActio...
else if (e.getActionCommand().equals("selectParent") || e.getActionCommand().equals("selectChild"))
else if (command.equals("selectParent") || command.equals("selectChild"))
public void actionPerformed(ActionEvent e) { TreePath lead = tree.getLeadSelectionPath(); if (e.getActionCommand().equals("selectPreviousChangeLead") || e.getActionCommand().equals("selectPreviousExtendSelection") || e.getActionCommand().equals("selectPrevious") || e.getActio...
else if (e.getActionCommand().equals("selectAll")) { TreePath[] paths = new TreePath[tree.getVisibleRowCount()]; Object curr = getNextVisibleNode(treeModel.getRoot()); int i = 0; while (curr != null && i < paths.length)
else if (command.equals("selectAll"))
public void actionPerformed(ActionEvent e) { TreePath lead = tree.getLeadSelectionPath(); if (e.getActionCommand().equals("selectPreviousChangeLead") || e.getActionCommand().equals("selectPreviousExtendSelection") || e.getActionCommand().equals("selectPrevious") || e.getActio...
paths[i] = new TreePath(getPathToRoot(curr, 0)); i++; }
TreePath[] paths = new TreePath[treeState.getRowCount()]; for (int i = 0; i < paths.length; i++) paths[i] = treeState.getPathForRow(i);
public void actionPerformed(ActionEvent e) { TreePath lead = tree.getLeadSelectionPath(); if (e.getActionCommand().equals("selectPreviousChangeLead") || e.getActionCommand().equals("selectPreviousExtendSelection") || e.getActionCommand().equals("selectPrevious") || e.getActio...
else if (e.getActionCommand().equals("startEditing"))
else if (command.equals("startEditing"))
public void actionPerformed(ActionEvent e) { TreePath lead = tree.getLeadSelectionPath(); if (e.getActionCommand().equals("selectPreviousChangeLead") || e.getActionCommand().equals("selectPreviousExtendSelection") || e.getActionCommand().equals("selectPrevious") || e.getActio...
else if (e.getActionCommand().equals("toggle"))
else if (command.equals("toggle"))
public void actionPerformed(ActionEvent e) { TreePath lead = tree.getLeadSelectionPath(); if (e.getActionCommand().equals("selectPreviousChangeLead") || e.getActionCommand().equals("selectPreviousExtendSelection") || e.getActionCommand().equals("selectPrevious") || e.getActio...
else if (e.getActionCommand().equals("clearSelection"))
else if (command.equals("clearSelection"))
public void actionPerformed(ActionEvent e) { TreePath lead = tree.getLeadSelectionPath(); if (e.getActionCommand().equals("selectPreviousChangeLead") || e.getActionCommand().equals("selectPreviousExtendSelection") || e.getActionCommand().equals("selectPrevious") || e.getActio...
if (tree.isEditing() && !e.getActionCommand().equals("startEditing"))
if (tree.isEditing() && ! command.equals("startEditing"))
public void actionPerformed(ActionEvent e) { TreePath lead = tree.getLeadSelectionPath(); if (e.getActionCommand().equals("selectPreviousChangeLead") || e.getActionCommand().equals("selectPreviousExtendSelection") || e.getActionCommand().equals("selectPrevious") || e.getActio...
tree.repaint();
treeState.setExpandedState(event.getPath(), false);
public void treeCollapsed(TreeExpansionEvent event) { validCachedPreferredSize = false; tree.repaint(); }
tree.repaint();
treeState.setExpandedState(event.getPath(), true);
public void treeExpanded(TreeExpansionEvent event) { validCachedPreferredSize = false; tree.repaint(); }
Object last = tree.getLeadSelectionPath().getLastPathComponent();
TreePath currentPath = tree.getLeadSelectionPath(); int currentRow;
public void actionPerformed(ActionEvent e) { Object last = tree.getLeadSelectionPath().getLastPathComponent(); if (e.getActionCommand().equals("selectPreviousChangeLead")) { Object prev = getPreviousVisibleNode(last); if (prev != null) { TreePath newPath...
if (e.getActionCommand().equals("selectPreviousChangeLead"))
if (currentPath != null) currentRow = treeState.getRowForPath(currentPath); else currentRow = 0; int rows = treeState.getRowCount(); int nextRow = currentRow + 1; int prevRow = currentRow - 1; boolean hasNext = nextRow < rows; boolean hasPrev = prevRow >= 0 && rows > 0; TreePath newPath; String command = e.getActionC...
public void actionPerformed(ActionEvent e) { Object last = tree.getLeadSelectionPath().getLastPathComponent(); if (e.getActionCommand().equals("selectPreviousChangeLead")) { Object prev = getPreviousVisibleNode(last); if (prev != null) { TreePath newPath...
Object prev = getPreviousVisibleNode(last); if (prev != null)
newPath = treeState.getPathForRow(prevRow); selectPath(tree, newPath); } else if (command.equals("selectNext") && hasNext) { newPath = treeState.getPathForRow(nextRow); selectPath(tree, newPath); } else if (command.equals("selectNextExtendSelection") && hasNext)
public void actionPerformed(ActionEvent e) { Object last = tree.getLeadSelectionPath().getLastPathComponent(); if (e.getActionCommand().equals("selectPreviousChangeLead")) { Object prev = getPreviousVisibleNode(last); if (prev != null) { TreePath newPath...
TreePath newPath = new TreePath(getPathToRoot(prev, 0));
newPath = treeState.getPathForRow(nextRow); tree.addSelectionPath(newPath); tree.setLeadSelectionPath(newPath); } else if (command.equals("selectNextChangeLead") && hasNext) { newPath = treeState.getPathForRow(nextRow);
public void actionPerformed(ActionEvent e) { Object last = tree.getLeadSelectionPath().getLastPathComponent(); if (e.getActionCommand().equals("selectPreviousChangeLead")) { Object prev = getPreviousVisibleNode(last); if (prev != null) { TreePath newPath...
else if (e.getActionCommand().equals("selectPreviousExtendSelection")) { Object prev = getPreviousVisibleNode(last); if (prev != null) { TreePath newPath = new TreePath(getPathToRoot(prev, 0)); tree.addSelectionPath(newPath); tree.setLeadSelectionPath(newPath); } } else if (e.getActionCommand().equals("selectPrevious")...
public void actionPerformed(ActionEvent e) { Object last = tree.getLeadSelectionPath().getLastPathComponent(); if (e.getActionCommand().equals("selectPreviousChangeLead")) { Object prev = getPreviousVisibleNode(last); if (prev != null) { TreePath newPath...
treeState.treeNodesChanged(e);
public void treeNodesChanged(TreeModelEvent e) { validCachedPreferredSize = false; tree.repaint(); }
treeState.treeNodesInserted(e);
public void treeNodesInserted(TreeModelEvent e) { validCachedPreferredSize = false; tree.repaint(); }
treeState.treeNodesRemoved(e);
public void treeNodesRemoved(TreeModelEvent e) { validCachedPreferredSize = false; tree.repaint(); }
treeState.treeStructureChanged(e);
public void treeStructureChanged(TreeModelEvent e) { if (e.getPath().length == 1 && !e.getPath()[0].equals(treeModel.getRoot())) tree.expandPath(new TreePath(treeModel.getRoot())); validCachedPreferredSize = false; tree.repaint(); }
Object last = tree.getLeadSelectionPath().getLastPathComponent();
TreePath current = tree.getLeadSelectionPath(); if (current == null) return;
public void actionPerformed(ActionEvent e) { Object last = tree.getLeadSelectionPath().getLastPathComponent(); if (e.getActionCommand().equals("selectParent")) { TreePath path = new TreePath(getPathToRoot(last, 0)); Object p = getParent(treeModel.getRoot(), last); if (...
{ TreePath path = new TreePath(getPathToRoot(last, 0)); Object p = getParent(treeModel.getRoot(), last); if (!treeModel.isLeaf(last)) toggleExpandState(path); else if (p != null) selectPath(tree, new TreePath(getPathToRoot(p, 0))); }
selectPath(tree, current.getParentPath());
public void actionPerformed(ActionEvent e) { Object last = tree.getLeadSelectionPath().getLastPathComponent(); if (e.getActionCommand().equals("selectParent")) { TreePath path = new TreePath(getPathToRoot(last, 0)); Object p = getParent(treeModel.getRoot(), last); if (...
TreePath path = new TreePath(getPathToRoot(last, 0));
Object node = current.getLastPathComponent(); int nc = treeModel.getChildCount(node); if (nc > 0) node = treeModel.getChild(node, 0);
public void actionPerformed(ActionEvent e) { Object last = tree.getLeadSelectionPath().getLastPathComponent(); if (e.getActionCommand().equals("selectParent")) { TreePath path = new TreePath(getPathToRoot(last, 0)); Object p = getParent(treeModel.getRoot(), last); if (...
if (!treeModel.isLeaf(last)) toggleExpandState(path); else { Object next = getNextVisibleNode(last); if (next != null) selectPath(tree, new TreePath(getPathToRoot(next, 0))); }
TreePath path = current.pathByAddingChild(node); selectPath(tree, path);
public void actionPerformed(ActionEvent e) { Object last = tree.getLeadSelectionPath().getLastPathComponent(); if (e.getActionCommand().equals("selectParent")) { TreePath path = new TreePath(getPathToRoot(last, 0)); Object p = getParent(treeModel.getRoot(), last); if (...
treeState.setNodeDimensions(nodeDimensions);
protected void configureLayoutCache() { treeState = createLayoutCache(); }
return new FixedHeightLayoutCache();
return new VariableHeightLayoutCache();
protected AbstractLayoutCache createLayoutCache() { return new FixedHeightLayoutCache(); }
int row = Math.round(y / getMaxHeight(tree)); TreePath path = getPathForRow(tree, row); while (row > 0 && path == null) { --row; path = getPathForRow(tree, row); } return path;
return treeState.getPathClosestTo(x, y);
public TreePath getClosestPathForLocation(JTree tree, int x, int y) { int row = Math.round(y / getMaxHeight(tree)); TreePath path = getPathForRow(tree, row); // no row is visible at this node while (row > 0 && path == null) { --row; path = getPathForRow(tree, row); } return pat...
private int getMaxHeight(JTree tree)
int getMaxHeight(JTree tree)
private int getMaxHeight(JTree tree) { if (maxHeight != 0) return maxHeight; Icon e = UIManager.getIcon("Tree.openIcon"); Icon c = UIManager.getIcon("Tree.closedIcon"); Icon l = UIManager.getIcon("Tree.leafIcon"); int rc = getRowCount(tree); int iconHeight = 0; for (int row = 0; row < rc; r...
if (c instanceof JTree) return ((JTree) c).getPreferredSize(); return new Dimension();
return getPreferredSize(c);
public Dimension getMaximumSize(JComponent c) { if (c instanceof JTree) return ((JTree) c).getPreferredSize(); return new Dimension(); }
Dimension min = getPreferredMinSize(); if (min == null) return new Dimension(); return min;
return preferredMinSize = getPreferredSize(c);
public Dimension getMinimumSize(JComponent c) { Dimension min = getPreferredMinSize(); if (min == null) return new Dimension(); return min; }
int row = -1; Object cell = null; if (path != null) { row = getRowForPath(tree, path); cell = path.getLastPathComponent(); } return nodeDimensions.getNodeDimensions(cell, row, getLevel(cell), tree.isExpanded(path), new Rectangle());
return treeState.getBounds(path, new Rectangle());
public Rectangle getPathBounds(JTree tree, TreePath path) { int row = -1; Object cell = null; if (path != null) { row = getRowForPath(tree, path); cell = path.getLastPathComponent(); } return nodeDimensions.getNodeDimensions(cell, row, getLevel(cell), ...
if (treeModel != null && currentVisiblePath != null) { Object[] nodes = currentVisiblePath.getPath(); if (row < nodes.length) return new TreePath(getPathToRoot(nodes[row], 0)); } return null;
return treeState.getPathForRow(row);
public TreePath getPathForRow(JTree tree, int row) { if (treeModel != null && currentVisiblePath != null) { Object[] nodes = currentVisiblePath.getPath(); if (row < nodes.length) return new TreePath(getPathToRoot(nodes[row], 0)); } return null; }
if (preferredMinSize == null) return getPreferredSize(tree); else
public Dimension getPreferredMinSize() { return preferredMinSize; }
if (currentVisiblePath != null) return currentVisiblePath.getPathCount(); return 0;
return treeState.getRowCount();
public int getRowCount(JTree tree) { if (currentVisiblePath != null) return currentVisiblePath.getPathCount(); return 0; }
int row = 0; Object dest = path.getLastPathComponent(); int rowCount = getRowCount(tree); if (currentVisiblePath != null) { Object[] nodes = currentVisiblePath.getPath(); while (row < rowCount) { if (dest.equals(nodes[row])) return row; row++; } } return -1;
return treeState.getRowForPath(path);
public int getRowForPath(JTree tree, TreePath path) { int row = 0; Object dest = path.getLastPathComponent(); int rowCount = getRowCount(tree); if (currentVisiblePath != null) { Object[] nodes = currentVisiblePath.getPath(); while (row < rowCount) { if (dest.equals(...
return treeState.getRowHeight();
return tree.getRowHeight();
protected int getRowHeight() { return treeState.getRowHeight(); }
setRootVisible(tree.isRootVisible()); treeState.setRootVisible(tree.isRootVisible());
public void installUI(JComponent c) { tree = (JTree) c; prepareForUIInstall(); super.installUI(c); installDefaults(); installComponents(); installKeyboardActions(); installListeners(); setCellEditor(createDefaultCellEditor()); createdCellEditor = true; isEditing = false; setModel...
updateCurrentVisiblePath();
public void paint(Graphics g, JComponent c) { JTree tree = (JTree) c; updateCurrentVisiblePath(); Rectangle clip = g.getClipBounds(); Insets insets = tree.getInsets(); if (clip != null && treeModel != null && currentVisiblePath != null) { int startIndex = tree.getClosestRowForLocation(cl...
if (clip != null && treeModel != null && currentVisiblePath != null)
if (clip != null && treeModel != null)
public void paint(Graphics g, JComponent c) { JTree tree = (JTree) c; updateCurrentVisiblePath(); Rectangle clip = g.getClipBounds(); Insets insets = tree.getInsets(); if (clip != null && treeModel != null && currentVisiblePath != null) { int startIndex = tree.getClosestRowForLocation(cl...
paintVerticalPartOfLeg(g, clip, insets, currentVisiblePath);
public void paint(Graphics g, JComponent c) { JTree tree = (JTree) c; updateCurrentVisiblePath(); Rectangle clip = g.getClipBounds(); Insets insets = tree.getInsets(); if (clip != null && treeModel != null && currentVisiblePath != null) { int startIndex = tree.getClosestRowForLocation(cl...
Object curr = currentVisiblePath.getPathComponent(i); boolean isLeaf = treeModel.isLeaf(curr); TreePath path = new TreePath(getPathToRoot(curr, 0));
TreePath path = treeState.getPathForRow(i); boolean isLeaf = treeModel.isLeaf(path.getLastPathComponent()); boolean isExpanded = tree.isExpanded(path);
public void paint(Graphics g, JComponent c) { JTree tree = (JTree) c; updateCurrentVisiblePath(); Rectangle clip = g.getClipBounds(); Insets insets = tree.getInsets(); if (clip != null && treeModel != null && currentVisiblePath != null) { int startIndex = tree.getClosestRowForLocation(cl...
boolean isExpanded = tree.isExpanded(path);
public void paint(Graphics g, JComponent c) { JTree tree = (JTree) c; updateCurrentVisiblePath(); Rectangle clip = g.getClipBounds(); Insets insets = tree.getInsets(); if (clip != null && treeModel != null && currentVisiblePath != null) { int startIndex = tree.getClosestRowForLocation(cl...
int rows = treeState.getRowCount(); if (endIndex < rows) for (int i = endIndex + 1; i < rows; i++) { TreePath path = treeState.getPathForRow(i); if (isLastChild(path)) paintVerticalPartOfLeg(g, clip, insets, path); }
public void paint(Graphics g, JComponent c) { JTree tree = (JTree) c; updateCurrentVisiblePath(); Rectangle clip = g.getClipBounds(); Insets insets = tree.getInsets(); if (clip != null && treeModel != null && currentVisiblePath != null) { int startIndex = tree.getClosestRowForLocation(cl...
if (tree.isVisible(path)) { if (!validCachedPreferredSize) updateCachedPreferredSize();
paintExpandControl(g, clipBounds, insets, bounds, path, row, isExpanded, hasBeenExpanded, isLeaf);
protected void paintRow(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) { boolean selected = tree.isPathSelected(path); boolean hasI...
paintExpandControl(g, clipBounds, insets, bounds, path, row, isExpanded, hasBeenExpanded, isLeaf); if (row != 0) bounds.x += gap; bounds.width = preferredSize.width + bounds.x;
protected void paintRow(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) { boolean selected = tree.isPathSelected(path); boolean hasI...
}
protected void paintRow(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) { boolean selected = tree.isPathSelected(path); boolean hasI...
int max = tree.getVisibleRowCount(); for (int i = 0; i < max; i++) { Object curr = path.getPathComponent(i); TreePath currPath = new TreePath(getPathToRoot(curr, 0)); int numChild = treeModel.getChildCount(curr); if (numChild > 0 && tree.isExpanded(currPath))
Rectangle bounds = getPathBounds(tree, path); TreePath parent = path.getParentPath(); if (parent != null)
protected void paintVerticalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, TreePath path) { int max = tree.getVisibleRowCount(); for (int i = 0; i < max; i++) { Object curr = path.getPathComponent(i); TreePath currPath = new TreePath(getPath...
Rectangle bounds = getPathBounds(tree, currPath); Rectangle lastChildBounds = getPathBounds( tree, new TreePath( getPathToRoot( treeModel.getChild( curr, numChild - 1), 0))); paintVerticalLine(g, tree, bounds.x + gap + 2, bounds.y + bounds.height - 2, lastChildBounds.y + lastChildBounds.height / 2); }
Rectangle parentBounds = getPathBounds(tree, parent); paintVerticalLine(g, tree, parentBounds.x + gap + 2, parentBounds.y + parentBounds.height / 2, bounds.y + bounds.height / 2);
protected void paintVerticalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, TreePath path) { int max = tree.getVisibleRowCount(); for (int i = 0; i < max; i++) { Object curr = path.getPathComponent(i); TreePath currPath = new TreePath(getPath...
treeState.setExpandedState(path, false);
protected void pathWasCollapsed(TreePath path) { validCachedPreferredSize = false; tree.repaint(); }
treeState.setExpandedState(path, true);
protected void pathWasExpanded(TreePath path) { validCachedPreferredSize = false; tree.repaint(); }
tree.scrollPathToVisible(path);
void selectPath(JTree tree, TreePath path) { if (path != null) { if (tree.getSelectionModel().getSelectionMode() == TreeSelectionModel.SINGLE_TREE_SELECTION) { tree.getSelectionModel().clearSelection(); tree.addSelectionPath(path); tree.setLeadSelectionPath(pa...
treeState.setModel(treeModel);
protected void setModel(TreeModel model) { tree.setModel(model); treeModel = tree.getModel(); }
rowHeight = Math.max(getMaxHeight(tree), 20);
rowHeight = getMaxHeight(tree);
protected void setRowHeight(int rowHeight) { if (rowHeight == 0) rowHeight = Math.max(getMaxHeight(tree), 20); treeState.setRowHeight(rowHeight); }
return (!isLeaf && getLevel(node) != 0 && hasControlIcons());
return (! isLeaf && hasControlIcons());
protected boolean shouldPaintExpandControl(TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) { Object node = path.getLastPathComponent(); return...
int maxWidth = 0; updateCurrentVisiblePath(); boolean isLeaf = false; if (currentVisiblePath != null) { Object[] path = currentVisiblePath.getPath(); for (int i = 0; i < path.length; i++) { TreePath curr = new TreePath(getPathToRoot(path[i], 0)); Rectangle bounds = getPathBounds(tree, curr); if (treeModel != null) isLe...
validCachedPreferredSize = false;
protected void updateCachedPreferredSize() { int maxWidth = 0; updateCurrentVisiblePath(); boolean isLeaf = false; if (currentVisiblePath != null) { Object[] path = currentVisiblePath.getPath(); for (int i = 0; i < path.length; i++) { TreePath curr = new TreePat...
} catch (TargetError targetError) { if (targetError.getTarget() instanceof WorkflowException) { throw (WorkflowException) targetError.getTarget(); } else { String message = "Could not get object registered in to variable map"; throw new WorkflowException(message, targetError.getTarget()); }
public Object registerVariable(WorkflowContext context, WorkflowEntry entry, Map args) throws WorkflowException { String script = (String) args.get(AbstractWorkflow.BSH_SCRIPT); Interpreter i = new Interpreter(); ClassLoader loader = Thread.currentThread().getContextClassLoader(); try { ...
log.debug(this + " NOT started yet!");
protected boolean isReady() { // If the client side consumer is not ready to accept a message and have it sent to it // or we're not grabbing a message for receiveNoWait we return null to refuse the message if (!active && !grabbing) { if (log.isTraceEnabled()) { log.trace(this + " not r...
persistenceArgs = new HashMap();
public static void load(InputStream is) throws FactoryException { try { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware(true); DocumentBuilder db = null; try { db = dbf.newDocumentBuilder(); } catch...
qualName = ((data.pack == null ? "" : data.pack.getName() + '.') + "$Proxy" + data.id);
qualName = (data.pack + "$Proxy" + data.id);
ClassFactory(ProxyData data) { methods = data.methods; // magic = 0xcafebabe // minor_version = 0 // major_version = 46 // constant_pool_count: place-holder for now pool.append("\u00ca\u00fe\u00ba\u00be\0\0\0\56\0\0"); // constant_pool...