rem stringlengths 0 477k | add stringlengths 0 313k | context stringlengths 6 599k |
|---|---|---|
public long getWTime() { | public synchronized long getWTime() { | public long getWTime() { return Ext2Utils.get32(data, 48); } |
public void setBlockGroupNr(int i) { | public synchronized void setBlockGroupNr(int i) { | public void setBlockGroupNr(int i) { Ext2Utils.set16(data, 90, i); setDirty(true); } |
public void setFreeBlocksCount(long count) { | public synchronized void setFreeBlocksCount(long count) { | public void setFreeBlocksCount(long count) { Ext2Utils.set32(data, 12, count); setDirty(true); } |
public void setFreeInodesCount(long count) { | public synchronized void setFreeInodesCount(long count) { | public void setFreeInodesCount(long count) { Ext2Utils.set32(data, 16, count); setDirty(true); } |
public void setState(int state) { | public synchronized void setState(int state) { | public void setState(int state) { Ext2Utils.set16(data, 58, state); setDirty(true); } |
public void setWTime(long time) { | public synchronized void setWTime(long time) { | public void setWTime(long time) { Ext2Utils.set32(data, 48, time); setDirty(true); } |
public void update() throws IOException { | public synchronized void update() throws IOException { | public void update() throws IOException { if(isDirty()) { log.debug("Updating superblock copies"); byte[] oldData; //update the main copy if(getFirstDataBlock()==0) { oldData=fs.getBlock(0); //the block size is an integer multiply of 1024, and if getFirstDataBlock==0, it's //at least 2048 bytes ... |
g.fillOval(0, 0, iconSize, iconSize); | g.fillOval(0, 0, ICON_SIZE, ICON_SIZE); | public void paintIcon(Component c, Graphics g, int x, int y) { g.translate(x, y); Color saved = g.getColor(); // Should be purple. g.setColor(Color.RED); g.fillOval(0, 0, iconSize, iconSize); g.setColor(Color.BLACK); g.drawOval(16, 6, 4, 4); Polygon bottomI = new Polygon(new int[] { 15, 15, 13, 13, 23, 23, 2... |
g.fillRect(0, 0, iconSize, iconSize); | g.fillRect(0, 0, ICON_SIZE, ICON_SIZE); | public void paintIcon(Component c, Graphics g, int x, int y) { g.translate(x, y); Color saved = g.getColor(); g.setColor(Color.GREEN); g.fillRect(0, 0, iconSize, iconSize); g.setColor(Color.BLACK); g.drawOval(11, 2, 16, 16); g.drawOval(14, 5, 10, 10); g.setColor(Color.GREEN); g.fillRect(0, 10, iconSize, icon... |
g.fillRect(0, 10, iconSize, iconSize - 10); | g.fillRect(0, 10, ICON_SIZE, ICON_SIZE - 10); | public void paintIcon(Component c, Graphics g, int x, int y) { g.translate(x, y); Color saved = g.getColor(); g.setColor(Color.GREEN); g.fillRect(0, 0, iconSize, iconSize); g.setColor(Color.BLACK); g.drawOval(11, 2, 16, 16); g.drawOval(14, 5, 10, 10); g.setColor(Color.GREEN); g.fillRect(0, 10, iconSize, icon... |
return iconSize; | return ICON_SIZE; | public int getIconHeight() { return iconSize; } |
return iconSize; | return ICON_SIZE; | public int getIconWidth() { return iconSize; } |
if (e.getPropertyName().equals(JOptionPane.ICON_PROPERTY) || e.getPropertyName().equals(JOptionPane.MESSAGE_TYPE_PROPERTY)) addIcon(messageAreaContainer); else if (e.getPropertyName().equals(JOptionPane.INITIAL_SELECTION_VALUE_PROPERTY)) resetSelectedValue(); else if (e.getPropertyName().equals(JOptionPane.INITIAL_VALU... | String property = e.getPropertyName(); if (property.equals(JOptionPane.ICON_PROPERTY) || property.equals(JOptionPane.INITIAL_SELECTION_VALUE_PROPERTY) || property.equals(JOptionPane.INITIAL_VALUE_PROPERTY) || property.equals(JOptionPane.MESSAGE_PROPERTY) || property.equals(JOptionPane.MESSAGE_TYPE_PROPERTY) || property... | public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals(JOptionPane.ICON_PROPERTY) || e.getPropertyName().equals(JOptionPane.MESSAGE_TYPE_PROPERTY)) addIcon(messageAreaContainer); else if (e.getPropertyName().equals(JOptionPane.INITIAL_SELECTION_VALUE_PROPERTY)) rese... |
Container newButtons = createButtonArea(); optionPane.remove(buttonContainer); optionPane.add(newButtons); buttonContainer = newButtons; | uninstallComponents(); installComponents(); optionPane.validate(); | public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals(JOptionPane.ICON_PROPERTY) || e.getPropertyName().equals(JOptionPane.MESSAGE_TYPE_PROPERTY)) addIcon(messageAreaContainer); else if (e.getPropertyName().equals(JOptionPane.INITIAL_SELECTION_VALUE_PROPERTY)) rese... |
else if (e.getPropertyName().equals(JOptionPane.MESSAGE_PROPERTY) || e.getPropertyName().equals(JOptionPane.WANTS_INPUT_PROPERTY) || e.getPropertyName().equals(JOptionPane.SELECTION_VALUES_PROPERTY)) { optionPane.remove(messageAreaContainer); messageAreaContainer = createMessageArea(); optionPane.add(messageAreaContain... | public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals(JOptionPane.ICON_PROPERTY) || e.getPropertyName().equals(JOptionPane.MESSAGE_TYPE_PROPERTY)) addIcon(messageAreaContainer); else if (e.getPropertyName().equals(JOptionPane.INITIAL_SELECTION_VALUE_PROPERTY)) rese... | |
configureLabel(iconLabel); | protected void addIcon(Container top) { JLabel iconLabel = null; Icon icon = getIcon(); if (icon != null) { iconLabel = new JLabel(icon); top.add(iconLabel, BorderLayout.WEST); } } | |
container.add(new JLabel((Icon) msg), cons); | JLabel label = new JLabel((Icon) msg); configureLabel(label); container.add(label, cons); | protected void addMessageComponents(Container container, GridBagConstraints cons, Object msg, int maxll, boolean internallyCreated) { if (msg == null) return; hasCustomComponents = internallyCreated; if (msg instanceof Object[]) ... |
addMessageComponents(container, cons, new JLabel(msg.toString()), maxll, true); | { JLabel label = new JLabel(msg.toString()); configureLabel(label); addMessageComponents(container, cons, label, maxll, true); } | protected void addMessageComponents(Container container, GridBagConstraints cons, Object msg, int maxll, boolean internallyCreated) { if (msg == null) return; hasCustomComponents = internallyCreated; if (msg instanceof Object[]) ... |
if ((remainder.length() > maxll || remainder.contains("\n"))) | if (remainder.length() > maxll || remainder.contains("\n")) | protected void burstStringInto(Container c, String d, int maxll) { if (d == null || c == null) return; int newlineIndex = d.indexOf('\n'); String line; String remainder; if (newlineIndex >= 0 && newlineIndex < maxll) { line = d.substring(0, newlineIndex); remainder = d.substrin... |
c.add(new JLabel(remainder)); | JLabel l = new JLabel(remainder); configureLabel(l); c.add(l); } | protected void burstStringInto(Container c, String d, int maxll) { if (d == null || c == null) return; int newlineIndex = d.indexOf('\n'); String line; String remainder; if (newlineIndex >= 0 && newlineIndex < maxll) { line = d.substring(0, newlineIndex); remainder = d.substrin... |
Border b = UIManager.getBorder("OptionPane.buttonAreaBorder"); if (b != null) buttonPanel.setBorder(b); | protected Container createButtonArea() { JPanel buttonPanel = new JPanel(); buttonPanel.setLayout(createLayoutManager()); addButtonComponents(buttonPanel, getButtons(), getInitialValueIndex()); return buttonPanel; } | |
Border messageBorder = UIManager.getBorder("OptionPane.messageAreaBorder"); if (messageBorder != null) messageArea.setBorder(messageBorder); | protected Container createMessageArea() { JPanel messageArea = new JPanel(); messageArea.setLayout(new BorderLayout()); addIcon(messageArea); JPanel rightSide = new JPanel(); rightSide.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); rightSide.setLayout(new GridBagLayout()); GridBagCo... | |
hasCustomComponents = false; Container msg = createMessageArea(); if (msg != null) { ((JComponent) msg).setBorder(messageBorder); msg.setForeground(messageForeground); messageAreaContainer = msg; optionPane.add(msg); } | optionPane.add(createMessageArea()); | protected void installComponents() { // reset it. hasCustomComponents = false; Container msg = createMessageArea(); if (msg != null) { ((JComponent) msg).setBorder(messageBorder); msg.setForeground(messageForeground); messageAreaContainer = msg; optionPane.add(msg); } // FIXME: Figure out if... |
Container button = createButtonArea(); if (button != null) { ((JComponent) button).setBorder(buttonBorder); buttonContainer = button; optionPane.add(button); } optionPane.setBorder(BorderFactory.createEmptyBorder(12, 12, 11, 11)); optionPane.invalidate(); | optionPane.add(createButtonArea()); | protected void installComponents() { // reset it. hasCustomComponents = false; Container msg = createMessageArea(); if (msg != null) { ((JComponent) msg).setBorder(messageBorder); msg.setForeground(messageForeground); messageAreaContainer = msg; optionPane.add(msg); } // FIXME: Figure out if... |
messageBorder = UIManager.getBorder("OptionPane.messageAreaBorder"); messageForeground = UIManager.getColor("OptionPane.messageForeground"); buttonBorder = UIManager.getBorder("OptionPane.buttonAreaBorder"); | protected void installDefaults() { LookAndFeel.installColorsAndFont(optionPane, "OptionPane.background", "OptionPane.foreground", "OptionPane.font"); LookAndFeel.installBorder(optionPane, "OptionPane.border"); optionPane.setOpaque(true)... | |
throws NotImplementedException | protected void installKeyboardActions() throws NotImplementedException { // FIXME: implement. } | |
Object[] bindings = (Object[]) SharedUIDefaults.get("OptionPane.windowBindings"); InputMap inputMap = LookAndFeel.makeComponentInputMap(optionPane, bindings); SwingUtilities.replaceUIInputMap(optionPane, JComponent.WHEN_IN_FOCUSED_WINDOW, inputMap); SwingUtilities.replaceUIActionMap(optionPane, getActionMap()); | protected void installKeyboardActions() throws NotImplementedException { // FIXME: implement. } | |
messageBorder = null; buttonBorder = null; messageForeground = null; | protected void uninstallDefaults() { optionPane.setFont(null); optionPane.setForeground(null); optionPane.setBackground(null); minimumSize = null; messageBorder = null; buttonBorder = null; messageForeground = null; // FIXME: ImageIcons don't seem to work properly /* warningIcon = null;... | |
SwingUtilities.replaceUIInputMap(optionPane, JComponent. WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null); SwingUtilities.replaceUIActionMap(optionPane, null); | protected void uninstallKeyboardActions() throws NotImplementedException { // FIXME: implement. } | |
return delimiter; | return (String) ((XMLAttribute) attribHash.get("delimiter")).getAttribValue(); | public String getDelimiter() { return delimiter; } |
return recordTerminator; | return (String) ((XMLAttribute) attribHash.get("recordTerminator")).getAttribValue(); | public String getRecordTerminator() { return recordTerminator; } |
return repeatable; | return (String) ((XMLAttribute) attribHash.get("repeatable")).getAttribValue(); | public String getRepeatable() { return repeatable; } |
attribHash.put("delimiter", new XMLAttribute(new String(" "), Constants.STRING_TYPE)); attribHash.put("repeatable", new XMLAttribute(new String("yes"), Constants.STRING_TYPE)); attribHash.put("recordTerminator", new XMLAttribute(Constants.NEW_LINE, Constants.STRING_TYPE)); | attribHash.put("delimiter", new XMLAttribute(DefaultDelimiter, Constants.STRING_TYPE)); attribHash.put("repeatable", new XMLAttribute(DefaultRepeatable, Constants.STRING_TYPE)); attribHash.put("recordTerminator", new XMLAttribute(DefaultRecordTerminator, Constants.STRING_TYPE)); | private void init() { classXDFNodeName = "textDelimiter"; attribOrder.add(0,"delimiter"); attribOrder.add(0,"repeatable"); attribOrder.add(0,"recordTerminator"); attribHash.put("delimiter", new XMLAttribute(new String(" "), Constants.STRING_TYPE)); attribHash.put("repeatable", new ... |
String delimiter = getDelimiter(); String repeatable = getRepeatable(); String recordTerminator = getRecordTerminator(); | private void nestedToXDF(OutputStream outputstream, String indent, int which, int stop) { if (which > stop) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + classXDFNodeName); if (delimiter !=null... | |
public String setDelimiter (String strDelimiter) | public void setDelimiter (String strDelimiter) | public String setDelimiter (String strDelimiter) { delimiter=strDelimiter; return delimiter; } |
delimiter=strDelimiter; return delimiter; | ((XMLAttribute) attribHash.get("delimiter")).setAttribValue(strDelimiter); | public String setDelimiter (String strDelimiter) { delimiter=strDelimiter; return delimiter; } |
public String setRecordTerminator (String strRecordTerminator) | public void setRecordTerminator (String strRecordTerminator) | public String setRecordTerminator (String strRecordTerminator) { recordTerminator = strRecordTerminator; return recordTerminator; } |
recordTerminator = strRecordTerminator; return recordTerminator; | ((XMLAttribute) attribHash.get("recordTerminator")).setAttribValue(strRecordTerminator); | public String setRecordTerminator (String strRecordTerminator) { recordTerminator = strRecordTerminator; return recordTerminator; } |
public String setRepeatable (String strIsRepeatable) | public void setRepeatable (String strIsRepeatable) | public String setRepeatable (String strIsRepeatable) { if (!strIsRepeatable.equals("yes") && !strIsRepeatable.equals("no") ) { Log.error("*repeatable* attribute can only be set to yes or no"); Log.error("tend to set as" + strIsRepeatable); Log.error("invalid. ignoring request"); return null; ... |
if (!strIsRepeatable.equals("yes") && !strIsRepeatable.equals("no") ) { Log.error("*repeatable* attribute can only be set to yes or no"); Log.error("tend to set as" + strIsRepeatable); Log.error("invalid. ignoring request"); return null; } repeatable=strIsRepeatable; return repeatable; | if (!strIsRepeatable.equals("yes") && !strIsRepeatable.equals("no") ) { Log.error("*repeatable* attribute can only be set to yes|no"); Log.error("tend to set as" + strIsRepeatable); Log.error("invalid. ignoring request"); return; } ((XMLAttribute) attribHash.get("repeatable")).setAttribValue(strIsRepeatable); | public String setRepeatable (String strIsRepeatable) { if (!strIsRepeatable.equals("yes") && !strIsRepeatable.equals("no") ) { Log.error("*repeatable* attribute can only be set to yes or no"); Log.error("tend to set as" + strIsRepeatable); Log.error("invalid. ignoring request"); return null; ... |
this.endOffset = offset + length; | public void insert(int offset, int length, ElementSpec[] data, DefaultDocumentEvent ev) { this.offset = offset; this.length = length; documentEvent = ev; // Push the root and the paragraph at offset onto the element stack. elementStack.clear(); elementStack.pus... | |
Element[] removed; | Element[] removed = new Element[] {current}; | private void insertContentTag(ElementSpec tag) { prepareContentInsertion(); int len = tag.getLength(); int dir = tag.getDirection(); if (dir == ElementSpec.JoinPreviousDirection) { // The mauve tests to this class show that a JoinPrevious insertion // does not add any... |
added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); | added[0] = createLeafElement(paragraph, tagAtts, offset, endOffset); | private void insertContentTag(ElementSpec tag) { prepareContentInsertion(); int len = tag.getLength(); int dir = tag.getDirection(); if (dir == ElementSpec.JoinPreviousDirection) { // The mauve tests to this class show that a JoinPrevious insertion // does not add any... |
removed = new Element[] { current }; | private void insertContentTag(ElementSpec tag) { prepareContentInsertion(); int len = tag.getLength(); int dir = tag.getDirection(); if (dir == ElementSpec.JoinPreviousDirection) { // The mauve tests to this class show that a JoinPrevious insertion // does not add any... | |
else if (current.getEndOffset() - length == offset) | else if (current.getEndOffset() == endOffset) | private void insertContentTag(ElementSpec tag) { prepareContentInsertion(); int len = tag.getLength(); int dir = tag.getDirection(); if (dir == ElementSpec.JoinPreviousDirection) { // The mauve tests to this class show that a JoinPrevious insertion // does not add any... |
added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); removed = new Element[] { current }; | added[1] = createLeafElement(paragraph, tagAtts, offset, endOffset); | private void insertContentTag(ElementSpec tag) { prepareContentInsertion(); int len = tag.getLength(); int dir = tag.getDirection(); if (dir == ElementSpec.JoinPreviousDirection) { // The mauve tests to this class show that a JoinPrevious insertion // does not add any... |
added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); | added[1] = createLeafElement(paragraph, tagAtts, offset, endOffset); | private void insertContentTag(ElementSpec tag) { prepareContentInsertion(); int len = tag.getLength(); int dir = tag.getDirection(); if (dir == ElementSpec.JoinPreviousDirection) { // The mauve tests to this class show that a JoinPrevious insertion // does not add any... |
return "section"; | return SectionElementName; | public String getName() { return "section"; } |
BranchElement paragraph = (BranchElement) createBranchElement(section, null); | BranchElement paragraph = new BranchElement(section, null); | protected AbstractDocument.AbstractElement createDefaultRoot() { Element[] tmp; // FIXME: Create a SecionElement here instead of a BranchElement. // Use createBranchElement() and createLeafElement instead. SectionElement section = new SectionElement(); BranchElement paragraph = (BranchElement) cr... |
return (Style) attributes.getResolveParent(); | AttributeSet a = attributes.getResolveParent(); if (a instanceof Style) return (Style) a; return null; | public Style getLogicalStyle(int position) { Element paragraph = getParagraphElement(position); AttributeSet attributes = paragraph.getAttributes(); return (Style) attributes.getResolveParent(); } |
for (int i = offset; i < endOffset; ++i) | int segmentEnd = txt.offset + txt.count; for (int i = txt.offset; i < segmentEnd; ++i) | protected void insertUpdate(DefaultDocumentEvent ev, AttributeSet attr) { super.insertUpdate(ev, attr); int offset = ev.getOffset(); int length = ev.getLength(); int endOffset = offset + length; Segment txt = new Segment(); try { getText(offset, length, txt); } catch (BadLocatio... |
if (i == endOffset - 1) { if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); } else if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } | protected void insertUpdate(DefaultDocumentEvent ev, AttributeSet attr) { super.insertUpdate(ev, attr); int offset = ev.getOffset(); int length = ev.getLength(); int endOffset = offset + length; Segment txt = new Segment(); try { getText(offset, length, txt); } catch (BadLocatio... | |
ElementSpec startTag = new ElementSpec(null, | ElementSpec startTag = new ElementSpec(paragraphAttributes, | protected void insertUpdate(DefaultDocumentEvent ev, AttributeSet attr) { super.insertUpdate(ev, attr); int offset = ev.getOffset(); int length = ev.getLength(); int endOffset = offset + length; Segment txt = new Segment(); try { getText(offset, length, txt); } catch (BadLocatio... |
offset += len; | protected void insertUpdate(DefaultDocumentEvent ev, AttributeSet attr) { super.insertUpdate(ev, attr); int offset = ev.getOffset(); int length = ev.getLength(); int endOffset = offset + length; Segment txt = new Segment(); try { getText(offset, length, txt); } catch (BadLocatio... | |
{ ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); | specs.add(new ElementSpec(attr, ElementSpec.ContentType, len)); ElementSpec last = (ElementSpec) specs.lastElement(); if (next.getAttributes().isEqual(attr)) last.setDirection(ElementSpec.JoinNextDirection); | protected void insertUpdate(DefaultDocumentEvent ev, AttributeSet attr) { super.insertUpdate(ev, attr); int offset = ev.getOffset(); int length = ev.getLength(); int endOffset = offset + length; Segment txt = new Segment(); try { getText(offset, length, txt); } catch (BadLocatio... |
if (specs.size() == 0) { | ElementSpec first = (ElementSpec) specs.firstElement(); | protected void insertUpdate(DefaultDocumentEvent ev, AttributeSet attr) { super.insertUpdate(ev, attr); int offset = ev.getOffset(); int length = ev.getLength(); int endOffset = offset + length; Segment txt = new Segment(); try { getText(offset, length, txt); } catch (BadLocatio... |
spec.setDirection(ElementSpec.JoinPreviousDirection); } else if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); specs.add(spec); } | first.setDirection(ElementSpec.JoinPreviousDirection); | protected void insertUpdate(DefaultDocumentEvent ev, AttributeSet attr) { super.insertUpdate(ev, attr); int offset = ev.getOffset(); int length = ev.getLength(); int endOffset = offset + length; Segment txt = new Segment(); try { getText(offset, length, txt); } catch (BadLocatio... |
int paragraphCount = root.getElementCount(); for (int pindex = 0; pindex < paragraphCount; pindex++) | int end = offset + length; Element curr; for (int pos = offset; pos < end; ) { curr = getCharacterElement(pos); if (pos == curr.getEndOffset()) break; MutableAttributeSet a = (MutableAttributeSet) curr.getAttributes(); ev.addEdit(new AttributeUndoableEdit(curr, attributes, replace)); if (replace) a.removeAttributes(... | public void setCharacterAttributes(int offset, int length, AttributeSet attributes, boolean replace) { DefaultDocumentEvent ev = new DefaultDocumentEvent(offset, length, DocumentEvent.EventType.CHANGE); // Modify the element structure so that the interval begins at an element /... |
Element paragraph = root.getElement(pindex); if ((paragraph.getStartOffset() > offset + length) || (paragraph.getEndOffset() < offset)) continue; int contentCount = paragraph.getElementCount(); for (int cindex = 0; cindex < contentCount; cindex++) { Element content = paragraph.getElement(cindex); if ((content.getSt... | writeUnlock(); | public void setCharacterAttributes(int offset, int length, AttributeSet attributes, boolean replace) { DefaultDocumentEvent ev = new DefaultDocumentEvent(offset, length, DocumentEvent.EventType.CHANGE); // Modify the element structure so that the interval begins at an element /... |
fireChangedUpdate(ev); | public void setCharacterAttributes(int offset, int length, AttributeSet attributes, boolean replace) { DefaultDocumentEvent ev = new DefaultDocumentEvent(offset, length, DocumentEvent.EventType.CHANGE); // Modify the element structure so that the interval begins at an element /... | |
throw new AssertionError("paragraph elements are expected to be" + "instances of javax.swing.text.AbstractDocument.AbstractElement"); | throw new AssertionError("paragraph elements are expected to be" + "instances of AbstractDocument.AbstractElement"); } finally { writeUnlock(); } | public void setLogicalStyle(int position, Style style) { Element el = getParagraphElement(position); if (el instanceof AbstractElement) { AbstractElement ael = (AbstractElement) el; ael.setResolveParent(style); } else throw new AssertionError("paragraph elements are expected to ... |
int index = offset; while (index < offset + length) | try | public void setParagraphAttributes(int offset, int length, AttributeSet attributes, boolean replace) { int index = offset; while (index < offset + length) { AbstractElement par = (AbstractElement) getParagraphElement(index); ... |
AbstractElement par = (AbstractElement) getParagraphElement(index); AttributeContext ctx = getAttributeContext(); | writeLock(); DefaultDocumentEvent ev = new DefaultDocumentEvent ( offset, length, DocumentEvent.EventType.CHANGE); Element rootElement = getDefaultRootElement(); int startElement = rootElement.getElementIndex(offset); int endElement = rootElement.getElementIndex(offset + length - 1); if (endElement < startElement... | public void setParagraphAttributes(int offset, int length, AttributeSet attributes, boolean replace) { int index = offset; while (index < offset + length) { AbstractElement par = (AbstractElement) getParagraphElement(index); ... |
par.removeAttributes(par); par.addAttributes(attributes); index = par.getElementCount(); | a.removeAttributes(a); a.addAttributes(attributes); } fireChangedUpdate(ev); fireUndoableEditUpdate(new UndoableEditEvent(this, ev)); } finally { writeUnlock(); | public void setParagraphAttributes(int offset, int length, AttributeSet attributes, boolean replace) { int index = offset; while (index < offset + length) { AbstractElement par = (AbstractElement) getParagraphElement(index); ... |
throw new AssertionError("BadLocationException must not be thrown " + "here. start=" + start + ", end=" + end | AssertionError as; as = new AssertionError("BadLocationException thrown " + "here. start=" + start + ", end=" + end | public LeafElement(Element parent, AttributeSet attributes, int start, int end) { super(parent, attributes); try { startPos = parent.getDocument().createPosition(start); endPos = parent.getDocument().createPosition(end); } catch (BadLocationException ex) { throw new Ass... |
as.initCause(ex); throw as; } | public LeafElement(Element parent, AttributeSet attributes, int start, int end) { super(parent, attributes); try { startPos = parent.getDocument().createPosition(start); endPos = parent.getDocument().createPosition(end); } catch (BadLocationException ex) { throw new Ass... | |
sessions.requestFocus(); | void jbInit() throws Exception { // make it non resizable setResizable(true); this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); // create some reusable borders and layouts Border etchedBorder = BorderFactory.createEtchedBorder(); BorderLayout borderLayout = new BorderLayout(); ... | |
updateColorSelection(newSelection); | private void applyAttributes() { if (!getStringProperty("font").equals( (String)fontsList.getSelectedItem()) ) { changes.firePropertyChange("font", getStringProperty("font"), (String)fontsList.getSelectedItem()); setProper... | |
if (defaultPrinter.isSelected()) { changes.firePropertyChange("defaultPrinter", getStringProperty("defaultPrinter"), "Yes"); setProperty("defaultPrinter","Yes"); } else { changes.firePropertyChange("defaultPrinter", getStringProperty("defaultPrinter"), "No"); setProperty("defaultPrinter","No"); } | private void applyAttributes() { if (!getStringProperty("font").equals( (String)fontsList.getSelectedItem()) ) { changes.firePropertyChange("font", getStringProperty("font"), (String)fontsList.getSelectedItem()); setProper... | |
attrib = new DefaultMutableTreeNode(LangTool.getString("sa.nodePrinter")); top.add(attrib); | private void createNodes(DefaultMutableTreeNode top) { DefaultMutableTreeNode attrib = null; attrib = new DefaultMutableTreeNode(LangTool.getString("sa.nodeColors")); top.add(attrib); attrib = new DefaultMutableTreeNode(LangTool.getString("sa.nodeDisplay")); top.add(attrib); ... | |
updateColorSelection(newSelection); | if (newSelection.equals(LangTool.getString("sa.bg"))) { jcc.setColor(getColorProperty("colorBg")); } if (newSelection.equals(LangTool.getString("sa.blue"))) { jcc.setColor(getColorProperty("colorBlue")); } if (newSelection.equals(LangTool.getString("sa.red"))) { jcc.setColor(getColorProperty("colorRed")); } if (newSel... | private void jbInit() throws Exception { changes = new PropertyChangeSupport(this); Dimension ps = null; // fonts Font[] fonts = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts(); // define fonts panel final JPanel fp = new JPanel(); fp.setLayout(new BorderLayout());... |
if (nodeInfo.toString().equals(LangTool.getString("sa.nodePrinter"))) { jp.removeAll(); jp.add(pp,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } | private void jbInit() throws Exception { changes = new PropertyChangeSupport(this); Dimension ps = null; // fonts Font[] fonts = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts(); // define fonts panel final JPanel fp = new JPanel(); fp.setLayout(new BorderLayout());... | |
updateColorSelection(newSelection); | if (newSelection.equals(LangTool.getString("sa.bg"))) { jcc.setColor(getColorProperty("colorBg")); } if (newSelection.equals(LangTool.getString("sa.blue"))) { jcc.setColor(getColorProperty("colorBlue")); } if (newSelection.equals(LangTool.getString("sa.red"))) { jcc.setColor(getColorProperty("colorRed")); } if (newSel... | public void actionPerformed(ActionEvent e) { JComboBox cb = (JComboBox)e.getSource(); String newSelection = (String)cb.getSelectedItem(); updateColorSelection(newSelection); } |
if (nodeInfo.toString().equals(LangTool.getString("sa.nodePrinter"))) { jp.removeAll(); jp.add(pp,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } | public void valueChanged(TreeSelectionEvent e) { DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent(); if (node == null) return; Object nodeInfo = node.getUserObject(); if (nodeInfo.to... | |
throw new BAD_OPERATION(); | BAD_OPERATION bad = new BAD_OPERATION(); bad.initCause(ex); bad.minor = Minor.Any; throw bad; | public static NotFoundReason extract(Any a) { try { return ((NotFoundReasonHolder) a.extract_Streamable()).value; } catch (ClassCastException ex) { throw new BAD_OPERATION(); } } |
super ("US-ASCII", new String[]{"ISO646-US"}); | super ("US-ASCII", new String[] { "iso-ir-6", "ANSI_X3.4-1986", "ISO_646.irv:1991", "ASCII", "ISO646-US", "ASCII", "us", "IBM367", "cp367", "csASCII", "ANSI_X3.4-1968", "iso_646.irv:1983", "ascii7", "646", "windows-20127" }); | US_ASCII () { super ("US-ASCII", new String[]{"ISO646-US"}); } |
bad.minor = Minor.Activation; | public final org.omg.CORBA.Object _this_object(ORB an_orb) { if (delegate != null) return delegate.this_object(this); else { if (an_orb instanceof ORB_1_4) { ORB_1_4 m_orb = (ORB_1_4) an_orb; gnuPOA dp = (gnuPOA) _default_POA(); if (dp == null) ... | |
g.setColor(darkShadow); g.drawRect(x, y, w - 2, h - 2); | if (c.isEnabled()) { g.setColor(darkShadow); g.drawRect(x, y, w - 2, h - 2); | public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { ButtonModel bmodel = null; if (c instanceof AbstractButton) bmodel = ((AbstractButton) c).getModel(); Color darkShadow = MetalLookAndFeel.getControlDarkShadow(); Color shadow... |
if (!bmodel.isPressed()) | if (!bmodel.isPressed()) { g.setColor(light); g.drawRect(x + 1, y + 1, w - 2, h - 2); g.setColor(middle); g.drawRect(x + 1, y + h - 2, 0, 0); g.drawRect(x + w - 2, y + 1, 0, 0); } else { g.setColor(light); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.se... | public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { ButtonModel bmodel = null; if (c instanceof AbstractButton) bmodel = ((AbstractButton) c).getModel(); Color darkShadow = MetalLookAndFeel.getControlDarkShadow(); Color shadow... |
g.setColor(light); g.drawRect(x + 1, y + 1, w - 2, h - 2); g.setColor(middle); g.drawRect(x + 1, y + h - 2, 0, 0); g.drawRect(x + w - 2, y + 1, 0, 0); } else { g.setColor(light); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(middle); g.drawLine(x... | g.setColor(MetalLookAndFeel.getInactiveControlTextColor()); g.drawRect(x, y, w - 2, h - 2); | public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { ButtonModel bmodel = null; if (c instanceof AbstractButton) bmodel = ((AbstractButton) c).getModel(); Color darkShadow = MetalLookAndFeel.getControlDarkShadow(); Color shadow... |
g.setColor(MetalLookAndFeel.getControl()); | if (f.isSelected()) g.setColor(MetalLookAndFeel.getPrimaryControlShadow()); else g.setColor(MetalLookAndFeel.getControlShadow()); | public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { JInternalFrame f = (JInternalFrame) c; if (f.isSelected()) g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow()); else g.setColor(MetalLookAndFeel.getControlDarkShadow()); /... |
{ if (c.isEnabled()) | { JTextComponent tc = (JTextComponent) c; if (tc.isEnabled() && tc.isEditable()) | public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { if (c.isEnabled()) super.paintBorder(c, g, x, y, w, h); else { Color savedColor = g.getColor(); g.setColor(MetalLookAndFeel.getControlShadow()); g.drawRect(x, y, w - 1... |
if (isRootPaneCheckingEnabled()) throw new Error("rootPaneChecking is enabled - adding components disallowed."); | if (comp == rootPane) | protected void addImpl(Component comp, Object constraints, int index) { if (isRootPaneCheckingEnabled()) throw new Error("rootPaneChecking is enabled - adding components disallowed."); super.addImpl(comp, constraints, index); } |
else { if (isRootPaneCheckingEnabled()) throw new Error("Do not add directly to JDialog." + " Use getContentPane().add instead."); getContentPane().add(comp, constraints, index); } | protected void addImpl(Component comp, Object constraints, int index) { if (isRootPaneCheckingEnabled()) throw new Error("rootPaneChecking is enabled - adding components disallowed."); super.addImpl(comp, constraints, index); } | |
setRootPaneCheckingEnabled(false); | protected void dialogInit() { // FIXME: Do a check on GraphicsEnvironment.isHeadless() setRootPaneCheckingEnabled(false); setLocale(JComponent.getDefaultLocale()); getRootPane(); // will do set/create setRootPaneCheckingEnabled(true); invalidate(); } | |
getRootPane(); setRootPaneCheckingEnabled(true); | getRootPane(); | protected void dialogInit() { // FIXME: Do a check on GraphicsEnvironment.isHeadless() setRootPaneCheckingEnabled(false); setLocale(JComponent.getDefaultLocale()); getRootPane(); // will do set/create setRootPaneCheckingEnabled(true); invalidate(); } |
initStageDone = true; | protected void dialogInit() { // FIXME: Do a check on GraphicsEnvironment.isHeadless() setRootPaneCheckingEnabled(false); setLocale(JComponent.getDefaultLocale()); getRootPane(); // will do set/create setRootPaneCheckingEnabled(true); invalidate(); } | |
if (operation == DO_NOTHING_ON_CLOSE || operation == HIDE_ON_CLOSE || operation == DISPOSE_ON_CLOSE) | public void setDefaultCloseOperation(int operation) { if (operation == DO_NOTHING_ON_CLOSE || operation == HIDE_ON_CLOSE || operation == DISPOSE_ON_CLOSE) close_action = operation; else // accept illegal value and set the property to the default value, // that's what the reference implementa... | |
else close_action = DO_NOTHING_ON_CLOSE; | public void setDefaultCloseOperation(int operation) { if (operation == DO_NOTHING_ON_CLOSE || operation == HIDE_ON_CLOSE || operation == DISPOSE_ON_CLOSE) close_action = operation; else // accept illegal value and set the property to the default value, // that's what the reference implementa... | |
throw new Error("rootPaneChecking is enabled - cannot set layout."); | throw new Error("Cannot set top-level layout. Use" + " getConentPane().setLayout instead."); getContentPane().setLayout(manager); } else | public void setLayout(LayoutManager manager) { if (isRootPaneCheckingEnabled()) throw new Error("rootPaneChecking is enabled - cannot set layout."); super.setLayout(manager); } |
Dialog (Dialog parent, String title, boolean modal, GraphicsConfiguration gc) | Dialog(Frame parent) | Dialog (Dialog parent, String title, boolean modal, GraphicsConfiguration gc){ super (parent, parent.getGraphicsConfiguration ()); // A null title is equivalent to an empty title this.title = (title != null) ? title : ""; this.modal = modal; visible = false; setLayout (new BorderLayout ());} |
super (parent, parent.getGraphicsConfiguration ()); this.title = (title != null) ? title : ""; this.modal = modal; visible = false; setLayout (new BorderLayout ()); | this(parent, "", false); | Dialog (Dialog parent, String title, boolean modal, GraphicsConfiguration gc){ super (parent, parent.getGraphicsConfiguration ()); // A null title is equivalent to an empty title this.title = (title != null) ? title : ""; this.modal = modal; visible = false; setLayout (new BorderLayout ());} |
bad.minor = Minor.Any; | public static ObjectNotActive extract(Any any) { try { EmptyExceptionHolder h = (EmptyExceptionHolder) any.extract_Streamable(); return (ObjectNotActive) h.value; } catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("ObjectNotActive expected"); ... | |
throw new Error ("Not implemented"); | if (accessibleContext == null) accessibleContext = new AccessibleAWTWindow(); return accessibleContext; | public AccessibleContext getAccessibleContext() { // FIXME //return null; throw new Error ("Not implemented"); } |
if (resized) | if (resized && isShowing ()) | void setBoundsCallback (int x, int y, int w, int h) { if (this.x == x && this.y == y && width == w && height == h) return; invalidate(); boolean resized = width != w || height != h; boolean moved = this.x != x || this.y != y; this.x = x; this.y = y; width = w; height = h; if (resized)... |
if (moved) | if (moved && isShowing ()) | void setBoundsCallback (int x, int y, int w, int h) { if (this.x == x && this.y == y && width == w && height == h) return; invalidate(); boolean resized = width != w || height != h; boolean moved = this.x != x || this.y != y; this.x = x; this.y = y; width = w; height = h; if (resized)... |
this.requestFocus(); | this.grabFocus(); | private void getFocusForMe() { this.requestFocus(); } |
public Throwable() { this("", null); | public Throwable(String message, Throwable cause) { this.detailMessage = message; this.cause = cause; fillInStackTrace(); | public Throwable() { this("", null); } |
System.out.println("Reading configuration."); | public static void configure(String configFileName) { Properties props = new Properties(); //the property hashtable try { FileInputStream istream = new FileInputStream(configFileName); props.load(istream); istream.close(); } catch (IOException e) { System.err.println("Could not read ... | |
public Edit(Element e, int i, Element[] removed, Element[] added) | Edit(Element el, int i) | public Edit(Element e, int i, Element[] removed, Element[] added) { this.e = e; this.index = i; addRemovedElements(removed); addAddedElements(added); } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.