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 System.arraycopy(data, 0, oldData, 1024, SUPERBLOCK_LENGTH); } else { oldData=fs.getBlock(getFirstDataBlock()); System.arraycopy(data, 0, oldData, 0, SUPERBLOCK_LENGTH); } fs.writeBlock(getFirstDataBlock(), oldData, true); //update the other copies for(int i=1; i<fs.getGroupCount(); i++) { //check if there is a superblock copy in the block group if(!fs.groupHasDescriptors(i)) continue; long blockNr=getFirstDataBlock() + i*getBlocksPerGroup(); oldData = fs.getBlock(blockNr); setBlockGroupNr(i); //update the old contents with the new superblock System.arraycopy(data, 0, oldData, 0, SUPERBLOCK_LENGTH); fs.writeBlock(blockNr, oldData, true); } setBlockGroupNr(0); setDirty(false); } } |
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, 21, 21 }, new int[] { 12, 28, 28, 30, 30, 28, 28, 12 }, 8); g.drawPolygon(bottomI); g.setColor(saved); g.translate(-x, -y); } |
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, iconSize - 10); g.setColor(Color.BLACK); g.drawLine(11, 10, 14, 10); g.drawLine(24, 10, 17, 22); g.drawLine(27, 10, 20, 22); g.drawLine(17, 22, 20, 22); g.drawOval(17, 25, 3, 3); g.setColor(saved); g.translate(-x, -y); } |
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, iconSize - 10); g.setColor(Color.BLACK); g.drawLine(11, 10, 14, 10); g.drawLine(24, 10, 17, 22); g.drawLine(27, 10, 20, 22); g.drawLine(17, 22, 20, 22); g.drawOval(17, 25, 3, 3); g.setColor(saved); g.translate(-x, -y); } |
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_VALUE_PROPERTY) || e.getPropertyName().equals(JOptionPane.OPTIONS_PROPERTY) || e.getPropertyName().equals(JOptionPane.OPTION_TYPE_PROPERTY)) | 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.equals(JOptionPane.OPTION_TYPE_PROPERTY) || property.equals(JOptionPane.OPTIONS_PROPERTY) || property.equals(JOptionPane.WANTS_INPUT_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)) resetSelectedValue(); else if (e.getPropertyName().equals(JOptionPane.INITIAL_VALUE_PROPERTY) || e.getPropertyName().equals(JOptionPane.OPTIONS_PROPERTY) || e.getPropertyName().equals(JOptionPane.OPTION_TYPE_PROPERTY)) { Container newButtons = createButtonArea(); optionPane.remove(buttonContainer); optionPane.add(newButtons); buttonContainer = newButtons; } 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(messageAreaContainer); Container newButtons = createButtonArea(); optionPane.remove(buttonContainer); optionPane.add(newButtons); buttonContainer = newButtons; optionPane.add(buttonContainer); } optionPane.invalidate(); optionPane.repaint(); } |
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)) resetSelectedValue(); else if (e.getPropertyName().equals(JOptionPane.INITIAL_VALUE_PROPERTY) || e.getPropertyName().equals(JOptionPane.OPTIONS_PROPERTY) || e.getPropertyName().equals(JOptionPane.OPTION_TYPE_PROPERTY)) { Container newButtons = createButtonArea(); optionPane.remove(buttonContainer); optionPane.add(newButtons); buttonContainer = newButtons; } 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(messageAreaContainer); Container newButtons = createButtonArea(); optionPane.remove(buttonContainer); optionPane.add(newButtons); buttonContainer = newButtons; optionPane.add(buttonContainer); } optionPane.invalidate(); optionPane.repaint(); } |
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(messageAreaContainer); Container newButtons = createButtonArea(); optionPane.remove(buttonContainer); optionPane.add(newButtons); buttonContainer = newButtons; optionPane.add(buttonContainer); } optionPane.invalidate(); optionPane.repaint(); | 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)) resetSelectedValue(); else if (e.getPropertyName().equals(JOptionPane.INITIAL_VALUE_PROPERTY) || e.getPropertyName().equals(JOptionPane.OPTIONS_PROPERTY) || e.getPropertyName().equals(JOptionPane.OPTION_TYPE_PROPERTY)) { Container newButtons = createButtonArea(); optionPane.remove(buttonContainer); optionPane.add(newButtons); buttonContainer = newButtons; } 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(messageAreaContainer); Container newButtons = createButtonArea(); optionPane.remove(buttonContainer); optionPane.add(newButtons); buttonContainer = newButtons; optionPane.add(buttonContainer); } optionPane.invalidate(); optionPane.repaint(); } |
|
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[]) { Object[] arr = (Object[]) msg; for (int i = 0; i < arr.length; i++) addMessageComponents(container, cons, arr[i], maxll, internallyCreated); return; } else if (msg instanceof Component) { container.add((Component) msg, cons); cons.gridy++; } else if (msg instanceof Icon) { container.add(new JLabel((Icon) msg), cons); cons.gridy++; } else { // Undocumented behaviour. // if msg.toString().length greater than maxll // it will create a box and burst the string. // otherwise, it will just create a label and re-call // this method with the label o.O if (msg.toString().length() > maxll || msg.toString().contains("\n")) { Box tmp = new Box(BoxLayout.Y_AXIS); burstStringInto(tmp, msg.toString(), maxll); addMessageComponents(container, cons, tmp, maxll, true); } else addMessageComponents(container, cons, new JLabel(msg.toString()), maxll, true); } } |
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[]) { Object[] arr = (Object[]) msg; for (int i = 0; i < arr.length; i++) addMessageComponents(container, cons, arr[i], maxll, internallyCreated); return; } else if (msg instanceof Component) { container.add((Component) msg, cons); cons.gridy++; } else if (msg instanceof Icon) { container.add(new JLabel((Icon) msg), cons); cons.gridy++; } else { // Undocumented behaviour. // if msg.toString().length greater than maxll // it will create a box and burst the string. // otherwise, it will just create a label and re-call // this method with the label o.O if (msg.toString().length() > maxll || msg.toString().contains("\n")) { Box tmp = new Box(BoxLayout.Y_AXIS); burstStringInto(tmp, msg.toString(), maxll); addMessageComponents(container, cons, tmp, maxll, true); } else addMessageComponents(container, cons, new JLabel(msg.toString()), maxll, true); } } |
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.substring(newlineIndex + 1); } else { line = d.substring(0, maxll); remainder = d.substring(maxll); } JLabel label = new JLabel(line); c.add(label); // If there is nothing left to burst, then we can stop. if (remainder.length() == 0) return; // Recursivly call ourselves to burst the remainder of the string, if ((remainder.length() > maxll || remainder.contains("\n"))) burstStringInto(c, remainder, maxll); else // Add the remainder to the container and be done. c.add(new JLabel(remainder)); } |
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.substring(newlineIndex + 1); } else { line = d.substring(0, maxll); remainder = d.substring(maxll); } JLabel label = new JLabel(line); c.add(label); // If there is nothing left to burst, then we can stop. if (remainder.length() == 0) return; // Recursivly call ourselves to burst the remainder of the string, if ((remainder.length() > maxll || remainder.contains("\n"))) burstStringInto(c, remainder, maxll); else // Add the remainder to the container and be done. c.add(new JLabel(remainder)); } |
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()); GridBagConstraints con = createConstraints(); addMessageComponents(rightSide, con, getMessage(), getMaxCharactersPerLineCount(), false); if (optionPane.getWantsInput()) { Object[] selection = optionPane.getSelectionValues(); if (selection == null) inputComponent = new JTextField(15); else if (selection.length < 20) inputComponent = new JComboBox(selection); else inputComponent = new JList(selection); if (inputComponent != null) { addMessageComponents(rightSide, con, inputComponent, getMaxCharactersPerLineCount(), false); resetSelectedValue(); selectInitialValue(optionPane); } } messageArea.add(rightSide, BorderLayout.CENTER); return messageArea; } |
|
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 the separator should be inserted here or what // this thing is supposed to do. Note: The JDK does NOT insert another // component at this place. The JOptionPane only has two panels in it // and there actually are applications that depend on this beeing so. Container sep = createSeparator(); if (sep != null) optionPane.add(sep); 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(); } |
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 the separator should be inserted here or what // this thing is supposed to do. Note: The JDK does NOT insert another // component at this place. The JOptionPane only has two panels in it // and there actually are applications that depend on this beeing so. Container sep = createSeparator(); if (sep != null) optionPane.add(sep); 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(); } |
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); messageBorder = UIManager.getBorder("OptionPane.messageAreaBorder"); messageForeground = UIManager.getColor("OptionPane.messageForeground"); buttonBorder = UIManager.getBorder("OptionPane.buttonAreaBorder"); minimumSize = UIManager.getDimension("OptionPane.minimumSize"); // FIXME: Image icons don't seem to work properly right now. // Once they do, replace the synthetic icons with these ones. /* warningIcon = (IconUIResource) defaults.getIcon("OptionPane.warningIcon"); infoIcon = (IconUIResource) defaults.getIcon("OptionPane.informationIcon"); errorIcon = (IconUIResource) defaults.getIcon("OptionPane.errorIcon"); questionIcon = (IconUIResource) defaults.getIcon("OptionPane.questionIcon"); */ } |
|
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; errorIcon = null; questionIcon = null; infoIcon = 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 XMLAttribute(new String("yes"), Constants.STRING_TYPE)); attribHash.put("recordTerminator", new XMLAttribute(Constants.NEW_LINE, Constants.STRING_TYPE)); } |
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) writeOut(outputstream, " delimiter =\"" + delimiter + "\""); writeOut(outputstream, " repeatable=\"" + repeatable + "\""); if (recordTerminator !=null) writeOut(outputstream, " recordTerminator=\"" + recordTerminator + "\"/>"); } else { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + UntaggedInstructionNodeName + " axisIdRef=\""); writeOut(outputstream, ((AxisInterface) parentArray.getAxisList().get(which)).getAxisId() + "\">"); which++; nestedToXDF(outputstream, indent + sPrettyXDFOutputIndentation, which, stop); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + UntaggedInstructionNodeName + ">"); } } |
|
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; } repeatable=strIsRepeatable; return repeatable; } |
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; } repeatable=strIsRepeatable; return repeatable; } |
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.push(root); elementStack.push(root.getElement(root.getElementIndex(offset))); numEndTags = 0; numStartTags = 0; insertUpdate(data); } |
|
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 edits to the document event. To me this means // that nothing is done here. The previous element naturally should // expand so that it covers the new characters. } else if (dir == ElementSpec.JoinNextDirection) { BranchElement paragraph = (BranchElement) elementStack.peek(); int currentIndex = paragraph.getElementIndex(offset); Element current = paragraph.getElement(currentIndex); Element next = paragraph.getElement(currentIndex + 1); Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); Element newEl2 = createLeafElement(paragraph, current.getAttributes(), offset, next.getEndOffset()); Element[] add = new Element[] {newEl1, newEl2}; Element[] remove = new Element[] {current, next}; paragraph.replace(currentIndex, 2, add); // Add this action to the document event. addEdit(paragraph, currentIndex, remove, add); } else { BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element current = paragraph.getElement(index); Element[] added; Element[] removed; Element[] splitRes = split(current, offset, length); // Special case for when offset == startOffset or offset == endOffset. if (splitRes[0] == null) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[0]; index++; } else if (current.getStartOffset() == offset) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[] { current }; } else if (current.getEndOffset() - length == offset) { added = new Element[2]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); removed = new Element[] { current }; } else { added = new Element[3]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[2] = splitRes[1]; removed = new Element[] { current }; } paragraph.replace(index, removed.length, added); addEdit(paragraph, index, removed, added); } offset += len; } |
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 edits to the document event. To me this means // that nothing is done here. The previous element naturally should // expand so that it covers the new characters. } else if (dir == ElementSpec.JoinNextDirection) { BranchElement paragraph = (BranchElement) elementStack.peek(); int currentIndex = paragraph.getElementIndex(offset); Element current = paragraph.getElement(currentIndex); Element next = paragraph.getElement(currentIndex + 1); Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); Element newEl2 = createLeafElement(paragraph, current.getAttributes(), offset, next.getEndOffset()); Element[] add = new Element[] {newEl1, newEl2}; Element[] remove = new Element[] {current, next}; paragraph.replace(currentIndex, 2, add); // Add this action to the document event. addEdit(paragraph, currentIndex, remove, add); } else { BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element current = paragraph.getElement(index); Element[] added; Element[] removed; Element[] splitRes = split(current, offset, length); // Special case for when offset == startOffset or offset == endOffset. if (splitRes[0] == null) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[0]; index++; } else if (current.getStartOffset() == offset) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[] { current }; } else if (current.getEndOffset() - length == offset) { added = new Element[2]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); removed = new Element[] { current }; } else { added = new Element[3]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[2] = splitRes[1]; removed = new Element[] { current }; } paragraph.replace(index, removed.length, added); addEdit(paragraph, index, removed, added); } offset += len; } |
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 edits to the document event. To me this means // that nothing is done here. The previous element naturally should // expand so that it covers the new characters. } else if (dir == ElementSpec.JoinNextDirection) { BranchElement paragraph = (BranchElement) elementStack.peek(); int currentIndex = paragraph.getElementIndex(offset); Element current = paragraph.getElement(currentIndex); Element next = paragraph.getElement(currentIndex + 1); Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); Element newEl2 = createLeafElement(paragraph, current.getAttributes(), offset, next.getEndOffset()); Element[] add = new Element[] {newEl1, newEl2}; Element[] remove = new Element[] {current, next}; paragraph.replace(currentIndex, 2, add); // Add this action to the document event. addEdit(paragraph, currentIndex, remove, add); } else { BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element current = paragraph.getElement(index); Element[] added; Element[] removed; Element[] splitRes = split(current, offset, length); // Special case for when offset == startOffset or offset == endOffset. if (splitRes[0] == null) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[0]; index++; } else if (current.getStartOffset() == offset) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[] { current }; } else if (current.getEndOffset() - length == offset) { added = new Element[2]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); removed = new Element[] { current }; } else { added = new Element[3]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[2] = splitRes[1]; removed = new Element[] { current }; } paragraph.replace(index, removed.length, added); addEdit(paragraph, index, removed, added); } offset += len; } |
|
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 edits to the document event. To me this means // that nothing is done here. The previous element naturally should // expand so that it covers the new characters. } else if (dir == ElementSpec.JoinNextDirection) { BranchElement paragraph = (BranchElement) elementStack.peek(); int currentIndex = paragraph.getElementIndex(offset); Element current = paragraph.getElement(currentIndex); Element next = paragraph.getElement(currentIndex + 1); Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); Element newEl2 = createLeafElement(paragraph, current.getAttributes(), offset, next.getEndOffset()); Element[] add = new Element[] {newEl1, newEl2}; Element[] remove = new Element[] {current, next}; paragraph.replace(currentIndex, 2, add); // Add this action to the document event. addEdit(paragraph, currentIndex, remove, add); } else { BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element current = paragraph.getElement(index); Element[] added; Element[] removed; Element[] splitRes = split(current, offset, length); // Special case for when offset == startOffset or offset == endOffset. if (splitRes[0] == null) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[0]; index++; } else if (current.getStartOffset() == offset) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[] { current }; } else if (current.getEndOffset() - length == offset) { added = new Element[2]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); removed = new Element[] { current }; } else { added = new Element[3]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[2] = splitRes[1]; removed = new Element[] { current }; } paragraph.replace(index, removed.length, added); addEdit(paragraph, index, removed, added); } offset += len; } |
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 edits to the document event. To me this means // that nothing is done here. The previous element naturally should // expand so that it covers the new characters. } else if (dir == ElementSpec.JoinNextDirection) { BranchElement paragraph = (BranchElement) elementStack.peek(); int currentIndex = paragraph.getElementIndex(offset); Element current = paragraph.getElement(currentIndex); Element next = paragraph.getElement(currentIndex + 1); Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); Element newEl2 = createLeafElement(paragraph, current.getAttributes(), offset, next.getEndOffset()); Element[] add = new Element[] {newEl1, newEl2}; Element[] remove = new Element[] {current, next}; paragraph.replace(currentIndex, 2, add); // Add this action to the document event. addEdit(paragraph, currentIndex, remove, add); } else { BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element current = paragraph.getElement(index); Element[] added; Element[] removed; Element[] splitRes = split(current, offset, length); // Special case for when offset == startOffset or offset == endOffset. if (splitRes[0] == null) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[0]; index++; } else if (current.getStartOffset() == offset) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[] { current }; } else if (current.getEndOffset() - length == offset) { added = new Element[2]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); removed = new Element[] { current }; } else { added = new Element[3]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[2] = splitRes[1]; removed = new Element[] { current }; } paragraph.replace(index, removed.length, added); addEdit(paragraph, index, removed, added); } offset += len; } |
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 edits to the document event. To me this means // that nothing is done here. The previous element naturally should // expand so that it covers the new characters. } else if (dir == ElementSpec.JoinNextDirection) { BranchElement paragraph = (BranchElement) elementStack.peek(); int currentIndex = paragraph.getElementIndex(offset); Element current = paragraph.getElement(currentIndex); Element next = paragraph.getElement(currentIndex + 1); Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); Element newEl2 = createLeafElement(paragraph, current.getAttributes(), offset, next.getEndOffset()); Element[] add = new Element[] {newEl1, newEl2}; Element[] remove = new Element[] {current, next}; paragraph.replace(currentIndex, 2, add); // Add this action to the document event. addEdit(paragraph, currentIndex, remove, add); } else { BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element current = paragraph.getElement(index); Element[] added; Element[] removed; Element[] splitRes = split(current, offset, length); // Special case for when offset == startOffset or offset == endOffset. if (splitRes[0] == null) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[0]; index++; } else if (current.getStartOffset() == offset) { added = new Element[2]; added[0] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[1] = splitRes[1]; removed = new Element[] { current }; } else if (current.getEndOffset() - length == offset) { added = new Element[2]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); removed = new Element[] { current }; } else { added = new Element[3]; added[0] = splitRes[0]; added[1] = createLeafElement(paragraph, tag.getAttributes(), offset, offset + length); added[2] = splitRes[1]; removed = new Element[] { current }; } paragraph.replace(index, removed.length, added); addEdit(paragraph, index, removed, added); } offset += len; } |
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) createBranchElement(section, null); paragraph.setResolveParent(getStyle(StyleContext.DEFAULT_STYLE)); tmp = new Element[1]; tmp[0] = paragraph; section.replace(0, 0, tmp); LeafElement leaf = new LeafElement(paragraph, null, 0, 1); tmp = new Element[1]; tmp[0] = leaf; paragraph.replace(0, 0, tmp); return section; } |
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 (BadLocationException ex) { AssertionError ae = new AssertionError("Unexpected bad location"); ae.initCause(ex); throw ae; } int len = 0; Vector specs = new Vector(); Element prev = getCharacterElement(offset); Element next = getCharacterElement(endOffset); for (int i = offset; i < endOffset; ++i) { len++; if (txt.array[i] == '\n') { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the last index, then check if we could probably be // joined with the next element. if (i == endOffset - 1) { if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); } // If we are at the first new element, then check if it could be // joined with the previous element. else if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } specs.add(spec); // Add ElementSpecs for the newline. ElementSpec endTag = new ElementSpec(null, ElementSpec.EndTagType); specs.add(endTag); ElementSpec startTag = new ElementSpec(null, ElementSpec.StartTagType); startTag.setDirection(ElementSpec.JoinFractureDirection); specs.add(startTag); len = 0; offset += len; } } // Create last element if last character hasn't been a newline. if (len > 0) { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the first new element, then check if it could be // joined with the previous element. if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } // Check if we could probably be joined with the next element. else if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); specs.add(spec); } ElementSpec[] elSpecs = (ElementSpec[]) specs.toArray(new ElementSpec[specs.size()]); buffer.insert(offset, length, elSpecs, ev); } |
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 (BadLocationException ex) { AssertionError ae = new AssertionError("Unexpected bad location"); ae.initCause(ex); throw ae; } int len = 0; Vector specs = new Vector(); Element prev = getCharacterElement(offset); Element next = getCharacterElement(endOffset); for (int i = offset; i < endOffset; ++i) { len++; if (txt.array[i] == '\n') { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the last index, then check if we could probably be // joined with the next element. if (i == endOffset - 1) { if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); } // If we are at the first new element, then check if it could be // joined with the previous element. else if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } specs.add(spec); // Add ElementSpecs for the newline. ElementSpec endTag = new ElementSpec(null, ElementSpec.EndTagType); specs.add(endTag); ElementSpec startTag = new ElementSpec(null, ElementSpec.StartTagType); startTag.setDirection(ElementSpec.JoinFractureDirection); specs.add(startTag); len = 0; offset += len; } } // Create last element if last character hasn't been a newline. if (len > 0) { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the first new element, then check if it could be // joined with the previous element. if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } // Check if we could probably be joined with the next element. else if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); specs.add(spec); } ElementSpec[] elSpecs = (ElementSpec[]) specs.toArray(new ElementSpec[specs.size()]); buffer.insert(offset, length, elSpecs, ev); } |
|
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 (BadLocationException ex) { AssertionError ae = new AssertionError("Unexpected bad location"); ae.initCause(ex); throw ae; } int len = 0; Vector specs = new Vector(); Element prev = getCharacterElement(offset); Element next = getCharacterElement(endOffset); for (int i = offset; i < endOffset; ++i) { len++; if (txt.array[i] == '\n') { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the last index, then check if we could probably be // joined with the next element. if (i == endOffset - 1) { if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); } // If we are at the first new element, then check if it could be // joined with the previous element. else if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } specs.add(spec); // Add ElementSpecs for the newline. ElementSpec endTag = new ElementSpec(null, ElementSpec.EndTagType); specs.add(endTag); ElementSpec startTag = new ElementSpec(null, ElementSpec.StartTagType); startTag.setDirection(ElementSpec.JoinFractureDirection); specs.add(startTag); len = 0; offset += len; } } // Create last element if last character hasn't been a newline. if (len > 0) { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the first new element, then check if it could be // joined with the previous element. if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } // Check if we could probably be joined with the next element. else if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); specs.add(spec); } ElementSpec[] elSpecs = (ElementSpec[]) specs.toArray(new ElementSpec[specs.size()]); buffer.insert(offset, length, elSpecs, ev); } |
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 (BadLocationException ex) { AssertionError ae = new AssertionError("Unexpected bad location"); ae.initCause(ex); throw ae; } int len = 0; Vector specs = new Vector(); Element prev = getCharacterElement(offset); Element next = getCharacterElement(endOffset); for (int i = offset; i < endOffset; ++i) { len++; if (txt.array[i] == '\n') { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the last index, then check if we could probably be // joined with the next element. if (i == endOffset - 1) { if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); } // If we are at the first new element, then check if it could be // joined with the previous element. else if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } specs.add(spec); // Add ElementSpecs for the newline. ElementSpec endTag = new ElementSpec(null, ElementSpec.EndTagType); specs.add(endTag); ElementSpec startTag = new ElementSpec(null, ElementSpec.StartTagType); startTag.setDirection(ElementSpec.JoinFractureDirection); specs.add(startTag); len = 0; offset += len; } } // Create last element if last character hasn't been a newline. if (len > 0) { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the first new element, then check if it could be // joined with the previous element. if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } // Check if we could probably be joined with the next element. else if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); specs.add(spec); } ElementSpec[] elSpecs = (ElementSpec[]) specs.toArray(new ElementSpec[specs.size()]); buffer.insert(offset, length, elSpecs, ev); } |
|
{ 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 (BadLocationException ex) { AssertionError ae = new AssertionError("Unexpected bad location"); ae.initCause(ex); throw ae; } int len = 0; Vector specs = new Vector(); Element prev = getCharacterElement(offset); Element next = getCharacterElement(endOffset); for (int i = offset; i < endOffset; ++i) { len++; if (txt.array[i] == '\n') { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the last index, then check if we could probably be // joined with the next element. if (i == endOffset - 1) { if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); } // If we are at the first new element, then check if it could be // joined with the previous element. else if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } specs.add(spec); // Add ElementSpecs for the newline. ElementSpec endTag = new ElementSpec(null, ElementSpec.EndTagType); specs.add(endTag); ElementSpec startTag = new ElementSpec(null, ElementSpec.StartTagType); startTag.setDirection(ElementSpec.JoinFractureDirection); specs.add(startTag); len = 0; offset += len; } } // Create last element if last character hasn't been a newline. if (len > 0) { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the first new element, then check if it could be // joined with the previous element. if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } // Check if we could probably be joined with the next element. else if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); specs.add(spec); } ElementSpec[] elSpecs = (ElementSpec[]) specs.toArray(new ElementSpec[specs.size()]); buffer.insert(offset, length, elSpecs, ev); } |
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 (BadLocationException ex) { AssertionError ae = new AssertionError("Unexpected bad location"); ae.initCause(ex); throw ae; } int len = 0; Vector specs = new Vector(); Element prev = getCharacterElement(offset); Element next = getCharacterElement(endOffset); for (int i = offset; i < endOffset; ++i) { len++; if (txt.array[i] == '\n') { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the last index, then check if we could probably be // joined with the next element. if (i == endOffset - 1) { if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); } // If we are at the first new element, then check if it could be // joined with the previous element. else if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } specs.add(spec); // Add ElementSpecs for the newline. ElementSpec endTag = new ElementSpec(null, ElementSpec.EndTagType); specs.add(endTag); ElementSpec startTag = new ElementSpec(null, ElementSpec.StartTagType); startTag.setDirection(ElementSpec.JoinFractureDirection); specs.add(startTag); len = 0; offset += len; } } // Create last element if last character hasn't been a newline. if (len > 0) { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the first new element, then check if it could be // joined with the previous element. if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } // Check if we could probably be joined with the next element. else if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); specs.add(spec); } ElementSpec[] elSpecs = (ElementSpec[]) specs.toArray(new ElementSpec[specs.size()]); buffer.insert(offset, length, elSpecs, ev); } |
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 (BadLocationException ex) { AssertionError ae = new AssertionError("Unexpected bad location"); ae.initCause(ex); throw ae; } int len = 0; Vector specs = new Vector(); Element prev = getCharacterElement(offset); Element next = getCharacterElement(endOffset); for (int i = offset; i < endOffset; ++i) { len++; if (txt.array[i] == '\n') { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the last index, then check if we could probably be // joined with the next element. if (i == endOffset - 1) { if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); } // If we are at the first new element, then check if it could be // joined with the previous element. else if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } specs.add(spec); // Add ElementSpecs for the newline. ElementSpec endTag = new ElementSpec(null, ElementSpec.EndTagType); specs.add(endTag); ElementSpec startTag = new ElementSpec(null, ElementSpec.StartTagType); startTag.setDirection(ElementSpec.JoinFractureDirection); specs.add(startTag); len = 0; offset += len; } } // Create last element if last character hasn't been a newline. if (len > 0) { ElementSpec spec = new ElementSpec(attr, ElementSpec.ContentType, len); // If we are at the first new element, then check if it could be // joined with the previous element. if (specs.size() == 0) { if (prev.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinPreviousDirection); } // Check if we could probably be joined with the next element. else if (next.getAttributes().isEqual(attr)) spec.setDirection(ElementSpec.JoinNextDirection); specs.add(spec); } ElementSpec[] elSpecs = (ElementSpec[]) specs.toArray(new ElementSpec[specs.size()]); buffer.insert(offset, length, elSpecs, ev); } |
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(a); a.addAttributes(attributes); pos = curr.getEndOffset(); } fireChangedUpdate(ev); fireUndoableEditUpdate(new UndoableEditEvent(this, ev)); } finally | 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 // start and ends at an element end. buffer.change(offset, length, ev); Element root = getDefaultRootElement(); // Visit all paragraph elements within the specified interval int paragraphCount = root.getElementCount(); for (int pindex = 0; pindex < paragraphCount; pindex++) { Element paragraph = root.getElement(pindex); // Skip paragraphs that lie outside the interval. if ((paragraph.getStartOffset() > offset + length) || (paragraph.getEndOffset() < offset)) continue; // Visit content elements within this paragraph int contentCount = paragraph.getElementCount(); for (int cindex = 0; cindex < contentCount; cindex++) { Element content = paragraph.getElement(cindex); // Skip content that lies outside the interval. if ((content.getStartOffset() > offset + length) || (content.getEndOffset() < offset)) continue; if (content instanceof AbstractElement) { AbstractElement el = (AbstractElement) content; if (replace) el.removeAttributes(el); el.addAttributes(attributes); } else throw new AssertionError("content elements are expected to be" + "instances of " + "javax.swing.text.AbstractDocument.AbstractElement"); } } fireChangedUpdate(ev); } |
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.getStartOffset() > offset + length) || (content.getEndOffset() < offset)) continue; if (content instanceof AbstractElement) { AbstractElement el = (AbstractElement) content; if (replace) el.removeAttributes(el); el.addAttributes(attributes); } else throw new AssertionError("content elements are expected to be" + "instances of " + "javax.swing.text.AbstractDocument.AbstractElement"); } | 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 // start and ends at an element end. buffer.change(offset, length, ev); Element root = getDefaultRootElement(); // Visit all paragraph elements within the specified interval int paragraphCount = root.getElementCount(); for (int pindex = 0; pindex < paragraphCount; pindex++) { Element paragraph = root.getElement(pindex); // Skip paragraphs that lie outside the interval. if ((paragraph.getStartOffset() > offset + length) || (paragraph.getEndOffset() < offset)) continue; // Visit content elements within this paragraph int contentCount = paragraph.getElementCount(); for (int cindex = 0; cindex < contentCount; cindex++) { Element content = paragraph.getElement(cindex); // Skip content that lies outside the interval. if ((content.getStartOffset() > offset + length) || (content.getEndOffset() < offset)) continue; if (content instanceof AbstractElement) { AbstractElement el = (AbstractElement) content; if (replace) el.removeAttributes(el); el.addAttributes(attributes); } else throw new AssertionError("content elements are expected to be" + "instances of " + "javax.swing.text.AbstractDocument.AbstractElement"); } } fireChangedUpdate(ev); } |
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 // start and ends at an element end. buffer.change(offset, length, ev); Element root = getDefaultRootElement(); // Visit all paragraph elements within the specified interval int paragraphCount = root.getElementCount(); for (int pindex = 0; pindex < paragraphCount; pindex++) { Element paragraph = root.getElement(pindex); // Skip paragraphs that lie outside the interval. if ((paragraph.getStartOffset() > offset + length) || (paragraph.getEndOffset() < offset)) continue; // Visit content elements within this paragraph int contentCount = paragraph.getElementCount(); for (int cindex = 0; cindex < contentCount; cindex++) { Element content = paragraph.getElement(cindex); // Skip content that lies outside the interval. if ((content.getStartOffset() > offset + length) || (content.getEndOffset() < offset)) continue; if (content instanceof AbstractElement) { AbstractElement el = (AbstractElement) content; if (replace) el.removeAttributes(el); el.addAttributes(attributes); } else throw new AssertionError("content elements are expected to be" + "instances of " + "javax.swing.text.AbstractDocument.AbstractElement"); } } fireChangedUpdate(ev); } |
|
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 be" + "instances of javax.swing.text.AbstractDocument.AbstractElement"); } |
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); AttributeContext ctx = getAttributeContext(); if (replace) par.removeAttributes(par); par.addAttributes(attributes); index = par.getElementCount(); } } |
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) endElement = startElement; for (int i = startElement; i <= endElement; i++) { Element par = rootElement.getElement(i); MutableAttributeSet a = (MutableAttributeSet) par.getAttributes(); ev.addEdit(new AttributeUndoableEdit(par, attributes, replace)); | public void setParagraphAttributes(int offset, int length, AttributeSet attributes, boolean replace) { int index = offset; while (index < offset + length) { AbstractElement par = (AbstractElement) getParagraphElement(index); AttributeContext ctx = getAttributeContext(); if (replace) par.removeAttributes(par); par.addAttributes(attributes); index = par.getElementCount(); } } |
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); AttributeContext ctx = getAttributeContext(); if (replace) par.removeAttributes(par); par.addAttributes(attributes); index = par.getElementCount(); } } |
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 AssertionError("BadLocationException must not be thrown " + "here. start=" + start + ", end=" + end + ", length=" + getLength()); } } |
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 AssertionError("BadLocationException must not be thrown " + "here. start=" + start + ", end=" + end + ", length=" + getLength()); } } |
|
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(); // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JTable(ctm); // Add enter as default key for connect with this session KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0); sessions.registerKeyboardAction(new ActionListener() { public void actionPerformed(ActionEvent e) { doActionConnect(); } },enter,JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); // setup the frame interface panel interfacePanel = new JPanel(); TitledBorder tb = BorderFactory.createTitledBorder( LangTool.getString("conf.labelPresentation")); interfacePanel.setBorder(tb); ButtonGroup intGroup = new ButtonGroup(); intTABS = new JRadioButton(LangTool.getString("conf.labelTABS")); intTABS.setSelected(true); intTABS.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { intTABS_itemStateChanged(e); } }); intMDI = new JRadioButton(LangTool.getString("conf.labelMDI")); // add the interface options to the group control intGroup.add(intTABS); intGroup.add(intMDI); if (props.containsKey("emul.interface")) { if (props.getProperty("emul.interface").equalsIgnoreCase("MDI")) intMDI.setSelected(true); } interfacePanel.add(intTABS); interfacePanel.add(intMDI); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); connectButton = addOptButton(LangTool.getString("ss.optConnect"),"CONNECT",options,false); addOptButton(LangTool.getString("ss.optCancel"),"DONE",options); // add the panels to our dialog getContentPane().add(sessionPanel,BorderLayout.CENTER); getContentPane().add(options, BorderLayout.SOUTH); getContentPane().add(interfacePanel,BorderLayout.NORTH); // pack it and center it on the screen pack(); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension frameSize = getSize(); if (frameSize.height > screenSize.height) frameSize.height = screenSize.height; if (frameSize.width > screenSize.width) frameSize.width = screenSize.width; setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2); // set default selection value as the first row if (sessions.getRowCount() > 0) { sessions.getSelectionModel().setSelectionInterval(0,0); } // now show the world what we and they can do this.setVisible(true); } |
|
updateColorSelection(newSelection); | private void applyAttributes() { if (!getStringProperty("font").equals( (String)fontsList.getSelectedItem()) ) { changes.firePropertyChange("font", getStringProperty("font"), (String)fontsList.getSelectedItem()); setProperty("font",(String)fontsList.getSelectedItem()); } String newSelection = (String)colorList.getSelectedItem(); if (colorSchema != null) { if (!getColorProperty("colorBg").equals(colorSchema.getColorBg())) { changes.firePropertyChange("colorBg", getColorProperty("colorBg"), colorSchema.getColorBg()); setProperty("colorBg",Integer.toString(colorSchema.getColorBg().getRGB())); } if (!getColorProperty("colorBlue").equals(colorSchema.getColorBlue())) { changes.firePropertyChange("colorBlue", getColorProperty("colorBlue"), colorSchema.getColorBlue()); setProperty("colorBlue",Integer.toString(colorSchema.getColorBlue().getRGB())); } if (!getColorProperty("colorRed").equals(colorSchema.getColorRed())) { changes.firePropertyChange("colorRed", getColorProperty("colorRed"), colorSchema.getColorRed()); setProperty("colorRed",Integer.toString(colorSchema.getColorRed().getRGB())); } if (!getColorProperty("colorPink").equals(colorSchema.getColorPink())) { changes.firePropertyChange("colorPink", getColorProperty("colorPink"), colorSchema.getColorPink()); setProperty("colorPink",Integer.toString(colorSchema.getColorPink().getRGB())); } if (!getColorProperty("colorGreen").equals(colorSchema.getColorGreen())) { changes.firePropertyChange("colorGreen", getColorProperty("colorGreen"), colorSchema.getColorGreen()); setProperty("colorGreen",Integer.toString(colorSchema.getColorGreen().getRGB())); } if (!getColorProperty("colorTurq").equals(colorSchema.getColorTurq())) { changes.firePropertyChange("colorTurq", getColorProperty("colorTurq"), colorSchema.getColorTurq()); setProperty("colorTurq",Integer.toString(colorSchema.getColorTurq().getRGB())); } if (!getColorProperty("colorYellow").equals(colorSchema.getColorYellow())) { changes.firePropertyChange("colorYellow", getColorProperty("colorYellow"), colorSchema.getColorYellow()); setProperty("colorYellow",Integer.toString(colorSchema.getColorYellow().getRGB())); } if (!getColorProperty("colorWhite").equals(colorSchema.getColorWhite())) { changes.firePropertyChange("colorWhite", getColorProperty("colorWhite"), colorSchema.getColorWhite()); setProperty("colorWhite",Integer.toString(colorSchema.getColorWhite().getRGB())); } if (!getColorProperty("colorGUIField").equals(colorSchema.getColorGuiField())) { changes.firePropertyChange("colorGUIField", getColorProperty("colorGUIField"), colorSchema.getColorGuiField()); setProperty("colorGUIField",Integer.toString(colorSchema.getColorGuiField().getRGB())); } if (!getColorProperty("colorCursor").equals(colorSchema.getColorCursor())) { changes.firePropertyChange("colorCursor", getColorProperty("colorCursor"), colorSchema.getColorCursor()); setProperty("colorCursor",Integer.toString(colorSchema.getColorCursor().getRGB())); } if (!getColorProperty("colorSep").equals(colorSchema.getColorSeparator())) { changes.firePropertyChange("colorSep", getColorProperty("colorSep"), colorSchema.getColorSeparator()); setProperty("colorSep", Integer.toString(colorSchema.getColorSeparator().getRGB())); } if (!getColorProperty("colorHexAttr").equals(colorSchema.getColorHexAttr())) { changes.firePropertyChange("colorHexAttr", getColorProperty("colorHexAttr"), colorSchema.getColorHexAttr()); setProperty("colorHexAttr", Integer.toString(colorSchema.getColorHexAttr().getRGB())); } updateColorSelection(newSelection); } else { Color nc = jcc.getColor(); if (newSelection.equals(LangTool.getString("sa.bg"))) { if (!getColorProperty("colorBg").equals(nc)) { changes.firePropertyChange("colorBg", getColorProperty("colorBg"), nc); setProperty("colorBg",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.blue"))) { if (!getColorProperty("colorBlue").equals(nc)) { changes.firePropertyChange("colorBlue", getColorProperty("colorBlue"), nc); setProperty("colorBlue",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.red"))) { if (!getColorProperty("colorRed").equals(nc)) { changes.firePropertyChange("colorRed", getColorProperty("colorRed"), nc); setProperty("colorRed",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.pink"))) { if (!getColorProperty("colorPink").equals(nc)) { changes.firePropertyChange("colorPink", getColorProperty("colorPink"), nc); setProperty("colorPink",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.green"))) { if (!getColorProperty("colorGreen").equals(nc)) { changes.firePropertyChange("colorGreen", getColorProperty("colorGreen"), nc); setProperty("colorGreen",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.turq"))) { if (!getColorProperty("colorTurq").equals(nc)) { changes.firePropertyChange("colorTurq", getColorProperty("colorTurq"), nc); setProperty("colorTurq",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.yellow"))) { if (!getColorProperty("colorYellow").equals(nc)) { changes.firePropertyChange("colorYellow", getColorProperty("colorYellow"), nc); setProperty("colorYellow",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.white"))) { if (!getColorProperty("colorWhite").equals(nc)) { changes.firePropertyChange("colorWhite", getColorProperty("colorWhite"), nc); setProperty("colorWhite",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.guiField"))) { if (!getColorProperty("colorGUIField").equals(nc)) { changes.firePropertyChange("colorGUIField", getColorProperty("colorGUIField"), nc); setProperty("colorGUIField",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.cursorColor"))) { if (!getColorProperty("colorCursor").equals(nc)) { changes.firePropertyChange("colorCursor", getColorProperty("colorCursor"), nc); setProperty("colorCursor",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.columnSep"))) { if (!getColorProperty("colorSep").equals(nc)) { changes.firePropertyChange("colorSep", getColorProperty("colorSep"), nc); setProperty("colorSep",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.cursorColor"))) { if (!getColorProperty("colorCursor").equals(nc)) { changes.firePropertyChange("colorCursor", getColorProperty("colorCursor"), nc); setProperty("colorCursor",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.hexAttrColor"))) { if (!getColorProperty("colorHexAttr").equals(nc)) { changes.firePropertyChange("colorHexAttr", getColorProperty("colorHexAttr"), nc); setProperty("colorHexAttr",Integer.toString(nc.getRGB())); } } } if (csLine.isSelected()) { changes.firePropertyChange("colSeparator", getStringProperty("colSeparator"), "Line"); setProperty("colSeparator","Line"); } else if (csShortLine.isSelected()) { changes.firePropertyChange("colSeparator", getStringProperty("colSeparator"), "ShortLine"); setProperty("colSeparator","ShortLine"); } else { changes.firePropertyChange("colSeparator", getStringProperty("colSeparator"), "Dot"); setProperty("colSeparator","Dot"); } if (cFull.isSelected()) { changes.firePropertyChange("cursorSize", getStringProperty("cursorSize"), "Full"); setProperty("cursorSize","Full"); } if (cHalf.isSelected()) { changes.firePropertyChange("cursorSize", getStringProperty("cursorSize"), "Half"); setProperty("cursorSize","Half"); } if (cLine.isSelected()) { changes.firePropertyChange("cursorSize", getStringProperty("cursorSize"), "Line"); setProperty("cursorSize","Line"); } if (chNone.isSelected()) { changes.firePropertyChange("crossHair", getStringProperty("crossHair"), "None"); setProperty("crossHair","None"); } if (chHorz.isSelected()) { changes.firePropertyChange("crossHair", getStringProperty("crossHair"), "Horz"); setProperty("crossHair","Horz"); } if (chVert.isSelected()) { changes.firePropertyChange("crossHair", getStringProperty("crossHair"), "Vert"); setProperty("crossHair","Vert"); } if (chCross.isSelected()) { changes.firePropertyChange("crossHair", getStringProperty("crossHair"), "Both"); setProperty("crossHair","Both"); } if (rulerFixed.isSelected()) { changes.firePropertyChange("rulerFixed", getStringProperty("rulerFixed"), "Yes"); setProperty("rulerFixed","Yes"); } else { changes.firePropertyChange("rulerFixed", getStringProperty("rulerFixed"), "No"); setProperty("rulerFixed","No"); } if (saNormal.isSelected()) { changes.firePropertyChange("showAttr", getStringProperty("showAttr"), "Normal"); setProperty("showAttr","Normal"); } else { changes.firePropertyChange("showAttr", getStringProperty("showAttr"), "Hex"); setProperty("showAttr","Hex"); } if (dceCheck.isSelected()) { changes.firePropertyChange("doubleClick", getStringProperty("doubleClick"), "Yes"); setProperty("doubleClick","Yes"); } else { changes.firePropertyChange("doubleClick", getStringProperty("doubleClick"), "No"); setProperty("doubleClick","No"); } if (guiCheck.isSelected()) { changes.firePropertyChange("guiInterface", getStringProperty("guiInterface"), "Yes"); setProperty("guiInterface","Yes"); } else { changes.firePropertyChange("guiInterface", getStringProperty("guiInterface"), "No"); setProperty("guiInterface","No"); } if (guiShowUnderline.isSelected()) { changes.firePropertyChange("guiShowUnderline", getStringProperty("guiShowUnderline"), "Yes"); setProperty("guiShowUnderline","Yes"); } else { changes.firePropertyChange("guiShowUnderline", getStringProperty("guiShowUnderline"), "No"); setProperty("guiShowUnderline","No"); } if (hsCheck.isSelected()) { changes.firePropertyChange("hotspots", getStringProperty("hotspots"), "Yes"); setProperty("hotspots","Yes"); } else { changes.firePropertyChange("hotspots", getStringProperty("hotspots"), "No"); setProperty("hotspots","No"); } if (kpCheck.isSelected()) { changes.firePropertyChange("keypad", getStringProperty("keypad"), "Yes"); setProperty("keypad","Yes"); } else { changes.firePropertyChange("keypad", getStringProperty("keypad"), "No"); setProperty("keypad","No"); } changes.firePropertyChange("hsMore", getStringProperty("hsMore"), hsMore.getText()); setProperty("hsMore",hsMore.getText()); changes.firePropertyChange("connectMacro", getStringProperty("connectMacro"), connectMacro.getText()); setProperty("connectMacro",connectMacro.getText()); changes.firePropertyChange("hsBottom", getStringProperty("hsBottom"), hsBottom.getText()); setProperty("hsBottom",hsBottom.getText()); changes.firePropertyChange("fontScaleHeight", getStringProperty("fontScaleHeight"), verticalScale.getText()); setProperty("fontScaleHeight",verticalScale.getText()); changes.firePropertyChange("fontScaleWidth", getStringProperty("fontScaleWidth"), horizontalScale.getText()); setProperty("fontScaleWidth",horizontalScale.getText()); changes.firePropertyChange("fontPointSize", getStringProperty("fontPointSize"), pointSize.getText()); setProperty("fontPointSize",pointSize.getText()); changes.firePropertyChange("cursorBottOffset", getStringProperty("cursorBottOffset"), cursorBottOffset.getText()); setProperty("cursorBottOffset",cursorBottOffset.getText()); setProperty("saveme","yes"); } |
|
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()); setProperty("font",(String)fontsList.getSelectedItem()); } String newSelection = (String)colorList.getSelectedItem(); if (colorSchema != null) { if (!getColorProperty("colorBg").equals(colorSchema.getColorBg())) { changes.firePropertyChange("colorBg", getColorProperty("colorBg"), colorSchema.getColorBg()); setProperty("colorBg",Integer.toString(colorSchema.getColorBg().getRGB())); } if (!getColorProperty("colorBlue").equals(colorSchema.getColorBlue())) { changes.firePropertyChange("colorBlue", getColorProperty("colorBlue"), colorSchema.getColorBlue()); setProperty("colorBlue",Integer.toString(colorSchema.getColorBlue().getRGB())); } if (!getColorProperty("colorRed").equals(colorSchema.getColorRed())) { changes.firePropertyChange("colorRed", getColorProperty("colorRed"), colorSchema.getColorRed()); setProperty("colorRed",Integer.toString(colorSchema.getColorRed().getRGB())); } if (!getColorProperty("colorPink").equals(colorSchema.getColorPink())) { changes.firePropertyChange("colorPink", getColorProperty("colorPink"), colorSchema.getColorPink()); setProperty("colorPink",Integer.toString(colorSchema.getColorPink().getRGB())); } if (!getColorProperty("colorGreen").equals(colorSchema.getColorGreen())) { changes.firePropertyChange("colorGreen", getColorProperty("colorGreen"), colorSchema.getColorGreen()); setProperty("colorGreen",Integer.toString(colorSchema.getColorGreen().getRGB())); } if (!getColorProperty("colorTurq").equals(colorSchema.getColorTurq())) { changes.firePropertyChange("colorTurq", getColorProperty("colorTurq"), colorSchema.getColorTurq()); setProperty("colorTurq",Integer.toString(colorSchema.getColorTurq().getRGB())); } if (!getColorProperty("colorYellow").equals(colorSchema.getColorYellow())) { changes.firePropertyChange("colorYellow", getColorProperty("colorYellow"), colorSchema.getColorYellow()); setProperty("colorYellow",Integer.toString(colorSchema.getColorYellow().getRGB())); } if (!getColorProperty("colorWhite").equals(colorSchema.getColorWhite())) { changes.firePropertyChange("colorWhite", getColorProperty("colorWhite"), colorSchema.getColorWhite()); setProperty("colorWhite",Integer.toString(colorSchema.getColorWhite().getRGB())); } if (!getColorProperty("colorGUIField").equals(colorSchema.getColorGuiField())) { changes.firePropertyChange("colorGUIField", getColorProperty("colorGUIField"), colorSchema.getColorGuiField()); setProperty("colorGUIField",Integer.toString(colorSchema.getColorGuiField().getRGB())); } if (!getColorProperty("colorCursor").equals(colorSchema.getColorCursor())) { changes.firePropertyChange("colorCursor", getColorProperty("colorCursor"), colorSchema.getColorCursor()); setProperty("colorCursor",Integer.toString(colorSchema.getColorCursor().getRGB())); } if (!getColorProperty("colorSep").equals(colorSchema.getColorSeparator())) { changes.firePropertyChange("colorSep", getColorProperty("colorSep"), colorSchema.getColorSeparator()); setProperty("colorSep", Integer.toString(colorSchema.getColorSeparator().getRGB())); } if (!getColorProperty("colorHexAttr").equals(colorSchema.getColorHexAttr())) { changes.firePropertyChange("colorHexAttr", getColorProperty("colorHexAttr"), colorSchema.getColorHexAttr()); setProperty("colorHexAttr", Integer.toString(colorSchema.getColorHexAttr().getRGB())); } updateColorSelection(newSelection); } else { Color nc = jcc.getColor(); if (newSelection.equals(LangTool.getString("sa.bg"))) { if (!getColorProperty("colorBg").equals(nc)) { changes.firePropertyChange("colorBg", getColorProperty("colorBg"), nc); setProperty("colorBg",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.blue"))) { if (!getColorProperty("colorBlue").equals(nc)) { changes.firePropertyChange("colorBlue", getColorProperty("colorBlue"), nc); setProperty("colorBlue",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.red"))) { if (!getColorProperty("colorRed").equals(nc)) { changes.firePropertyChange("colorRed", getColorProperty("colorRed"), nc); setProperty("colorRed",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.pink"))) { if (!getColorProperty("colorPink").equals(nc)) { changes.firePropertyChange("colorPink", getColorProperty("colorPink"), nc); setProperty("colorPink",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.green"))) { if (!getColorProperty("colorGreen").equals(nc)) { changes.firePropertyChange("colorGreen", getColorProperty("colorGreen"), nc); setProperty("colorGreen",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.turq"))) { if (!getColorProperty("colorTurq").equals(nc)) { changes.firePropertyChange("colorTurq", getColorProperty("colorTurq"), nc); setProperty("colorTurq",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.yellow"))) { if (!getColorProperty("colorYellow").equals(nc)) { changes.firePropertyChange("colorYellow", getColorProperty("colorYellow"), nc); setProperty("colorYellow",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.white"))) { if (!getColorProperty("colorWhite").equals(nc)) { changes.firePropertyChange("colorWhite", getColorProperty("colorWhite"), nc); setProperty("colorWhite",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.guiField"))) { if (!getColorProperty("colorGUIField").equals(nc)) { changes.firePropertyChange("colorGUIField", getColorProperty("colorGUIField"), nc); setProperty("colorGUIField",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.cursorColor"))) { if (!getColorProperty("colorCursor").equals(nc)) { changes.firePropertyChange("colorCursor", getColorProperty("colorCursor"), nc); setProperty("colorCursor",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.columnSep"))) { if (!getColorProperty("colorSep").equals(nc)) { changes.firePropertyChange("colorSep", getColorProperty("colorSep"), nc); setProperty("colorSep",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.cursorColor"))) { if (!getColorProperty("colorCursor").equals(nc)) { changes.firePropertyChange("colorCursor", getColorProperty("colorCursor"), nc); setProperty("colorCursor",Integer.toString(nc.getRGB())); } } if (newSelection.equals(LangTool.getString("sa.hexAttrColor"))) { if (!getColorProperty("colorHexAttr").equals(nc)) { changes.firePropertyChange("colorHexAttr", getColorProperty("colorHexAttr"), nc); setProperty("colorHexAttr",Integer.toString(nc.getRGB())); } } } if (csLine.isSelected()) { changes.firePropertyChange("colSeparator", getStringProperty("colSeparator"), "Line"); setProperty("colSeparator","Line"); } else if (csShortLine.isSelected()) { changes.firePropertyChange("colSeparator", getStringProperty("colSeparator"), "ShortLine"); setProperty("colSeparator","ShortLine"); } else { changes.firePropertyChange("colSeparator", getStringProperty("colSeparator"), "Dot"); setProperty("colSeparator","Dot"); } if (cFull.isSelected()) { changes.firePropertyChange("cursorSize", getStringProperty("cursorSize"), "Full"); setProperty("cursorSize","Full"); } if (cHalf.isSelected()) { changes.firePropertyChange("cursorSize", getStringProperty("cursorSize"), "Half"); setProperty("cursorSize","Half"); } if (cLine.isSelected()) { changes.firePropertyChange("cursorSize", getStringProperty("cursorSize"), "Line"); setProperty("cursorSize","Line"); } if (chNone.isSelected()) { changes.firePropertyChange("crossHair", getStringProperty("crossHair"), "None"); setProperty("crossHair","None"); } if (chHorz.isSelected()) { changes.firePropertyChange("crossHair", getStringProperty("crossHair"), "Horz"); setProperty("crossHair","Horz"); } if (chVert.isSelected()) { changes.firePropertyChange("crossHair", getStringProperty("crossHair"), "Vert"); setProperty("crossHair","Vert"); } if (chCross.isSelected()) { changes.firePropertyChange("crossHair", getStringProperty("crossHair"), "Both"); setProperty("crossHair","Both"); } if (rulerFixed.isSelected()) { changes.firePropertyChange("rulerFixed", getStringProperty("rulerFixed"), "Yes"); setProperty("rulerFixed","Yes"); } else { changes.firePropertyChange("rulerFixed", getStringProperty("rulerFixed"), "No"); setProperty("rulerFixed","No"); } if (saNormal.isSelected()) { changes.firePropertyChange("showAttr", getStringProperty("showAttr"), "Normal"); setProperty("showAttr","Normal"); } else { changes.firePropertyChange("showAttr", getStringProperty("showAttr"), "Hex"); setProperty("showAttr","Hex"); } if (dceCheck.isSelected()) { changes.firePropertyChange("doubleClick", getStringProperty("doubleClick"), "Yes"); setProperty("doubleClick","Yes"); } else { changes.firePropertyChange("doubleClick", getStringProperty("doubleClick"), "No"); setProperty("doubleClick","No"); } if (guiCheck.isSelected()) { changes.firePropertyChange("guiInterface", getStringProperty("guiInterface"), "Yes"); setProperty("guiInterface","Yes"); } else { changes.firePropertyChange("guiInterface", getStringProperty("guiInterface"), "No"); setProperty("guiInterface","No"); } if (guiShowUnderline.isSelected()) { changes.firePropertyChange("guiShowUnderline", getStringProperty("guiShowUnderline"), "Yes"); setProperty("guiShowUnderline","Yes"); } else { changes.firePropertyChange("guiShowUnderline", getStringProperty("guiShowUnderline"), "No"); setProperty("guiShowUnderline","No"); } if (hsCheck.isSelected()) { changes.firePropertyChange("hotspots", getStringProperty("hotspots"), "Yes"); setProperty("hotspots","Yes"); } else { changes.firePropertyChange("hotspots", getStringProperty("hotspots"), "No"); setProperty("hotspots","No"); } if (kpCheck.isSelected()) { changes.firePropertyChange("keypad", getStringProperty("keypad"), "Yes"); setProperty("keypad","Yes"); } else { changes.firePropertyChange("keypad", getStringProperty("keypad"), "No"); setProperty("keypad","No"); } changes.firePropertyChange("hsMore", getStringProperty("hsMore"), hsMore.getText()); setProperty("hsMore",hsMore.getText()); changes.firePropertyChange("connectMacro", getStringProperty("connectMacro"), connectMacro.getText()); setProperty("connectMacro",connectMacro.getText()); changes.firePropertyChange("hsBottom", getStringProperty("hsBottom"), hsBottom.getText()); setProperty("hsBottom",hsBottom.getText()); changes.firePropertyChange("fontScaleHeight", getStringProperty("fontScaleHeight"), verticalScale.getText()); setProperty("fontScaleHeight",verticalScale.getText()); changes.firePropertyChange("fontScaleWidth", getStringProperty("fontScaleWidth"), horizontalScale.getText()); setProperty("fontScaleWidth",horizontalScale.getText()); changes.firePropertyChange("fontPointSize", getStringProperty("fontPointSize"), pointSize.getText()); setProperty("fontPointSize",pointSize.getText()); changes.firePropertyChange("cursorBottOffset", getStringProperty("cursorBottOffset"), cursorBottOffset.getText()); setProperty("cursorBottOffset",cursorBottOffset.getText()); setProperty("saveme","yes"); } |
|
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); attrib = new DefaultMutableTreeNode(LangTool.getString("sa.nodeCursor")); top.add(attrib); attrib = new DefaultMutableTreeNode(LangTool.getString("sa.nodeFonts")); top.add(attrib); attrib = new DefaultMutableTreeNode(LangTool.getString("sa.nodeSignoff")); top.add(attrib); attrib = new DefaultMutableTreeNode(LangTool.getString("sa.nodeOnConnect")); top.add(attrib); attrib = new DefaultMutableTreeNode(LangTool.getString("sa.nodeMouse")); top.add(attrib); attrib = new DefaultMutableTreeNode(LangTool.getString("sa.nodeHS")); top.add(attrib); attrib = new DefaultMutableTreeNode(LangTool.getString("sa.nodeKP")); top.add(attrib); attrib = new DefaultMutableTreeNode(LangTool.getString("sa.nodei18n")); 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 (newSelection.equals(LangTool.getString("sa.pink"))) { jcc.setColor(getColorProperty("colorPink")); } if (newSelection.equals(LangTool.getString("sa.green"))) { jcc.setColor(getColorProperty("colorGreen")); } if (newSelection.equals(LangTool.getString("sa.turq"))) { jcc.setColor(getColorProperty("colorTurq")); } if (newSelection.equals(LangTool.getString("sa.yellow"))) { jcc.setColor(getColorProperty("colorYellow")); } if (newSelection.equals(LangTool.getString("sa.white"))) { jcc.setColor(getColorProperty("colorWhite")); } if (newSelection.equals(LangTool.getString("sa.guiField"))) { jcc.setColor(getColorProperty("colorGUIField",Color.white)); } if (newSelection.equals(LangTool.getString("sa.cursorColor"))) { jcc.setColor(getColorProperty("colorCursor", getColorProperty("colorBg"))); } if (newSelection.equals(LangTool.getString("sa.columnSep"))) { jcc.setColor(getColorProperty("colorSep", getColorProperty("colorWhite"))); } if (newSelection.equals(LangTool.getString("sa.hexAttrColor"))) { jcc.setColor(getColorProperty("colorHexAttr", getColorProperty("colorWhite"))); } | 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()); JPanel flp = new JPanel(); TitledBorder tb = BorderFactory.createTitledBorder(LangTool.getString("sa.font")); flp.setBorder(tb); fontsList = new JComboBox(); String font = getStringProperty("font"); for (int x = 0; x < fonts.length; x++) { if (fonts[x].getFontName().indexOf('.') < 0) fontsList.addItem(fonts[x].getFontName()); } fontsList.setSelectedItem(font); flp.add(fontsList); JPanel fsp = new JPanel(); fsp.setLayout(new AlignLayout(2,5,5)); tb = BorderFactory.createTitledBorder(LangTool.getString("sa.scaleLabel")); fsp.setBorder(tb); verticalScale = new JTextField("1.2",5); horizontalScale = new JTextField("1.0",5); pointSize = new JTextField("0",5); if (getStringProperty("fontScaleWidth").length() != 0) horizontalScale.setText(getStringProperty("fontScaleWidth")); if (getStringProperty("fontScaleHeight").length() != 0) verticalScale.setText(getStringProperty("fontScaleHeight")); if (getStringProperty("fontPointSize").length() != 0) pointSize.setText(getStringProperty("fontPointSize")); fsp.add(new JLabel(LangTool.getString("sa.fixedPointSize"))); fsp.add(pointSize); fsp.add(new JLabel(LangTool.getString("sa.horScaleLabel"))); fsp.add(horizontalScale); fsp.add(new JLabel(LangTool.getString("sa.vertScaleLabel"))); fsp.add(verticalScale); fp.add(flp,BorderLayout.NORTH); fp.add(fsp,BorderLayout.SOUTH); // define colors panel final JPanel cpp = new JPanel(); cpp.setLayout(new BorderLayout()); JPanel cp = new JPanel(); cp.setLayout(new BorderLayout()); JPanel cschp = new JPanel(); tb = BorderFactory.createTitledBorder(LangTool.getString("sa.colorSchema")); cschp.setBorder(tb); colorSchemaList = new JComboBox(); loadSchemas(colorSchemaList); colorSchemaList.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JComboBox cb = (JComboBox)e.getSource(); Object obj = cb.getSelectedItem(); if (obj instanceof Schema) { System.out.println(" we got a schema "); colorSchema = (Schema)obj; } else { colorSchema = null; } } }); cschp.add(colorSchemaList); tb = BorderFactory.createTitledBorder(LangTool.getString("sa.colors")); cp.setBorder(tb); colorList = new JComboBox(); colorList.addItem(LangTool.getString("sa.bg")); colorList.addItem(LangTool.getString("sa.blue")); colorList.addItem(LangTool.getString("sa.red")); colorList.addItem(LangTool.getString("sa.pink")); colorList.addItem(LangTool.getString("sa.green")); colorList.addItem(LangTool.getString("sa.turq")); colorList.addItem(LangTool.getString("sa.yellow")); colorList.addItem(LangTool.getString("sa.white")); colorList.addItem(LangTool.getString("sa.guiField")); colorList.addItem(LangTool.getString("sa.cursorColor")); colorList.addItem(LangTool.getString("sa.columnSep")); colorList.addItem(LangTool.getString("sa.hexAttrColor")); jcc = new JColorChooser(); // set the default color for display as that being for back ground jcc.setColor(getColorProperty("colorBg")); colorList.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JComboBox cb = (JComboBox)e.getSource(); String newSelection = (String)cb.getSelectedItem(); updateColorSelection(newSelection); } }); cp.add(colorList,BorderLayout.NORTH); cp.add(jcc,BorderLayout.CENTER); cpp.add(cschp,BorderLayout.NORTH); cpp.add(cp,BorderLayout.CENTER); // define display panel final JPanel display = new JPanel(); display.setLayout(new BoxLayout(display,BoxLayout.Y_AXIS)); // define column separator panel JPanel csp = new JPanel(); tb = BorderFactory.createTitledBorder(LangTool.getString("sa.cs")); csp.setBorder(tb); csLine = new JRadioButton(LangTool.getString("sa.csLine")); csLine.setActionCommand("Line"); csDot = new JRadioButton(LangTool.getString("sa.csDot")); csDot.setActionCommand("Dot"); csShortLine = new JRadioButton(LangTool.getString("sa.csShortLine")); csShortLine.setActionCommand("ShortLine"); // Group the radio buttons. ButtonGroup csGroup = new ButtonGroup(); csGroup.add(csLine); csGroup.add(csDot); csGroup.add(csShortLine); if (getStringProperty("colSeparator").equals("Dot")) csDot.setSelected(true); else if (getStringProperty("colSeparator").equals("ShortLine")) csShortLine.setSelected(true); else csLine.setSelected(true); csp.add(csLine); csp.add(csDot); csp.add(csShortLine); // define show attributs panel JPanel sap = new JPanel(); sap.setBorder( BorderFactory.createTitledBorder(LangTool.getString("sa.showAttr"))); saNormal = new JRadioButton(LangTool.getString("sa.showNormal")); saNormal.setActionCommand("Normal"); JRadioButton saHex = new JRadioButton(LangTool.getString("sa.showHex")); saHex.setActionCommand("Hex"); // Group the radio buttons. ButtonGroup saGroup = new ButtonGroup(); saGroup.add(saNormal); saGroup.add(saHex); if (getStringProperty("showAttr").equals("Hex")) saHex.setSelected(true); else saNormal.setSelected(true); sap.add(saNormal); sap.add(saHex); // define gui panel JPanel cgp = new JPanel(); cgp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.cgp"))); cgp.setLayout(new AlignLayout(1,5,5));// cgp.setLayout(new BoxLayout(cgp,BoxLayout.Y_AXIS)); guiCheck = new JCheckBox(LangTool.getString("sa.guiCheck")); guiShowUnderline = new JCheckBox(LangTool.getString("sa.guiShowUnderline")); if (getStringProperty("guiInterface").equals("Yes")) guiCheck.setSelected(true); // since this is a new property added then it might not exist in existing // profiles and it should be defaulted to yes. String under = getStringProperty("guiShowUnderline"); if (under.equals("Yes") || under.length() == 0) guiShowUnderline.setSelected(true); cgp.add(guiCheck); cgp.add(guiShowUnderline); display.add(csp); display.add(sap); display.add(cgp); // define cursor panel final JPanel cuPanel = new JPanel(); cuPanel.setLayout(new BoxLayout(cuPanel,BoxLayout.Y_AXIS)); // define cursor size panel JPanel crp = new JPanel(); crp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.crsSize"))); cFull = new JRadioButton(LangTool.getString("sa.cFull")); cHalf = new JRadioButton(LangTool.getString("sa.cHalf")); cLine = new JRadioButton(LangTool.getString("sa.cLine")); // Group the radio buttons. ButtonGroup cGroup = new ButtonGroup(); cGroup.add(cFull); cGroup.add(cHalf); cGroup.add(cLine); int cursorSize = 0; if (getStringProperty("cursorSize").equals("Full")) cursorSize = 2; if (getStringProperty("cursorSize").equals("Half")) cursorSize = 1; switch (cursorSize) { case 0: cLine.setSelected(true); break; case 1: cHalf.setSelected(true); break; case 2: cFull.setSelected(true); break; } crp.add(cFull); crp.add(cHalf); crp.add(cLine); // define cursor ruler panel JPanel chp = new JPanel(); chp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.crossHair"))); chNone = new JRadioButton(LangTool.getString("sa.chNone")); chHorz = new JRadioButton(LangTool.getString("sa.chHorz")); chVert = new JRadioButton(LangTool.getString("sa.chVert")); chCross = new JRadioButton(LangTool.getString("sa.chCross")); // Group the radio buttons. ButtonGroup chGroup = new ButtonGroup(); chGroup.add(chNone); chGroup.add(chHorz); chGroup.add(chVert); chGroup.add(chCross); int crossHair = 0; if (getStringProperty("crossHair").equals("Horz")) crossHair = 1; if (getStringProperty("crossHair").equals("Vert")) crossHair = 2; if (getStringProperty("crossHair").equals("Both")) crossHair = 3; switch (crossHair) { case 0: chNone.setSelected(true); break; case 1: chHorz.setSelected(true); break; case 2: chVert.setSelected(true); break; case 3: chCross.setSelected(true); break; } chp.add(chNone); chp.add(chHorz); chp.add(chVert); chp.add(chCross); // define double click as enter JPanel rulerFPanel = new JPanel(); rulerFPanel.setBorder(BorderFactory.createTitledBorder("")); rulerFixed = new JCheckBox(LangTool.getString("sa.rulerFixed")); rulerFPanel.add(rulerFixed); // define double click as enter JPanel bottOffPanel = new JPanel(); bottOffPanel.setBorder(BorderFactory.createTitledBorder( LangTool.getString("sa.curBottOffset"))); cursorBottOffset = new JTextField(5); try { int i = Integer.parseInt(getStringProperty("cursorBottOffset","0")); cursorBottOffset.setText(Integer.toString(i)); } catch (NumberFormatException ne) { cursorBottOffset.setText("0"); } bottOffPanel.add(cursorBottOffset); cuPanel.add(crp); cuPanel.add(chp); cuPanel.add(rulerFPanel); cuPanel.add(bottOffPanel); // define onConnect panel final JPanel onConnect = new JPanel(); onConnect.setLayout(new BoxLayout(onConnect,BoxLayout.Y_AXIS)); // define onConnect macro to run JPanel ocMacrop = new JPanel(); ocMacrop.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.connectMacro"))); connectMacro = new JTextField(); connectMacro.setColumns(30); // check if double click sends enter connectMacro.setText(getStringProperty("connectMacro")); ocMacrop.add(connectMacro); onConnect.add(ocMacrop); // define mouse panel final JPanel mouse = new JPanel(); mouse.setLayout(new BoxLayout(mouse,BoxLayout.Y_AXIS)); // define double click as enter JPanel dcep = new JPanel(); dcep.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.doubleClick"))); dceCheck = new JCheckBox(LangTool.getString("sa.sendEnter")); // check if double click sends enter dceCheck.setSelected(getStringProperty("doubleClick").equals("Yes")); dcep.add(dceCheck); mouse.add(dcep); // define hotspot panel final JPanel hotspot = new JPanel(); hotspot.setLayout(new BoxLayout(hotspot,BoxLayout.Y_AXIS)); // define hsPanel panel JPanel hsp = new JPanel(); hsp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.hsp"))); hsCheck = new JCheckBox(LangTool.getString("sa.hsCheck")); if (getStringProperty("hotspots").equals("Yes")) hsCheck.setSelected(true); hsp.add(hsCheck); // define assignment panel JPanel hsap = new JPanel(); hsap.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.hsap"))); hsap.setLayout(new GridLayout(2,2)); JLabel moreLabel = new JLabel(LangTool.getString("sa.hsMore")); JLabel bottomLabel = new JLabel(LangTool.getString("sa.hsBottom")); hsMore = new JTextField(getStringProperty("hsMore")); hsBottom = new JTextField(getStringProperty("hsBottom")); hsap.add(moreLabel); hsap.add(hsMore); hsap.add(bottomLabel); hsap.add(hsBottom); hotspot.add(hsp); hotspot.add(hsap); // define Key Pad panel final JPanel kp = new JPanel(); kp.setLayout(new BoxLayout(kp,BoxLayout.Y_AXIS)); // define kpPanel panel JPanel kpp = new JPanel(); kpp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.kpp"))); kpCheck = new JCheckBox(LangTool.getString("sa.kpCheck")); if (getStringProperty("keypad").equals("Yes")) kpCheck.setSelected(true); kpp.add(kpCheck); kp.add(kpp); // define default final JPanel jp = new JPanel(); jp.add(cpp,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); //Create the nodes. DefaultMutableTreeNode top = new DefaultMutableTreeNode(fileName); createNodes(top); //Create a tree that allows one selection at a time. final JTree tree = new JTree(top); tree.getSelectionModel().setSelectionMode (TreeSelectionModel.SINGLE_TREE_SELECTION); //Listen for when the selection changes. tree.addTreeSelectionListener(new TreeSelectionListener() { public void valueChanged(TreeSelectionEvent e) { DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent(); if (node == null) return; Object nodeInfo = node.getUserObject(); if (nodeInfo.toString().equals(LangTool.getString("sa.nodeFonts"))) { jp.removeAll(); jp.add(fp,BorderLayout.NORTH); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeColors"))) { jp.removeAll(); jp.add(cpp,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeDisplay"))) { jp.removeAll(); jp.add(display,BorderLayout.NORTH); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeCursor"))) { jp.removeAll(); jp.add(cuPanel,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeOnConnect"))) { jp.removeAll(); jp.add(onConnect,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeMouse"))) { jp.removeAll(); jp.add(mouse,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeHS"))) { jp.removeAll(); jp.add(hotspot,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeKP"))) { jp.removeAll(); jp.add(kp,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } } }); // define tree selection panel JPanel jsp = new JPanel(); jsp.setBackground(Color.white); jsp.add(tree); jpm.add(jp,BorderLayout.EAST); jpm.add(jsp,BorderLayout.WEST); } |
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()); JPanel flp = new JPanel(); TitledBorder tb = BorderFactory.createTitledBorder(LangTool.getString("sa.font")); flp.setBorder(tb); fontsList = new JComboBox(); String font = getStringProperty("font"); for (int x = 0; x < fonts.length; x++) { if (fonts[x].getFontName().indexOf('.') < 0) fontsList.addItem(fonts[x].getFontName()); } fontsList.setSelectedItem(font); flp.add(fontsList); JPanel fsp = new JPanel(); fsp.setLayout(new AlignLayout(2,5,5)); tb = BorderFactory.createTitledBorder(LangTool.getString("sa.scaleLabel")); fsp.setBorder(tb); verticalScale = new JTextField("1.2",5); horizontalScale = new JTextField("1.0",5); pointSize = new JTextField("0",5); if (getStringProperty("fontScaleWidth").length() != 0) horizontalScale.setText(getStringProperty("fontScaleWidth")); if (getStringProperty("fontScaleHeight").length() != 0) verticalScale.setText(getStringProperty("fontScaleHeight")); if (getStringProperty("fontPointSize").length() != 0) pointSize.setText(getStringProperty("fontPointSize")); fsp.add(new JLabel(LangTool.getString("sa.fixedPointSize"))); fsp.add(pointSize); fsp.add(new JLabel(LangTool.getString("sa.horScaleLabel"))); fsp.add(horizontalScale); fsp.add(new JLabel(LangTool.getString("sa.vertScaleLabel"))); fsp.add(verticalScale); fp.add(flp,BorderLayout.NORTH); fp.add(fsp,BorderLayout.SOUTH); // define colors panel final JPanel cpp = new JPanel(); cpp.setLayout(new BorderLayout()); JPanel cp = new JPanel(); cp.setLayout(new BorderLayout()); JPanel cschp = new JPanel(); tb = BorderFactory.createTitledBorder(LangTool.getString("sa.colorSchema")); cschp.setBorder(tb); colorSchemaList = new JComboBox(); loadSchemas(colorSchemaList); colorSchemaList.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JComboBox cb = (JComboBox)e.getSource(); Object obj = cb.getSelectedItem(); if (obj instanceof Schema) { System.out.println(" we got a schema "); colorSchema = (Schema)obj; } else { colorSchema = null; } } }); cschp.add(colorSchemaList); tb = BorderFactory.createTitledBorder(LangTool.getString("sa.colors")); cp.setBorder(tb); colorList = new JComboBox(); colorList.addItem(LangTool.getString("sa.bg")); colorList.addItem(LangTool.getString("sa.blue")); colorList.addItem(LangTool.getString("sa.red")); colorList.addItem(LangTool.getString("sa.pink")); colorList.addItem(LangTool.getString("sa.green")); colorList.addItem(LangTool.getString("sa.turq")); colorList.addItem(LangTool.getString("sa.yellow")); colorList.addItem(LangTool.getString("sa.white")); colorList.addItem(LangTool.getString("sa.guiField")); colorList.addItem(LangTool.getString("sa.cursorColor")); colorList.addItem(LangTool.getString("sa.columnSep")); colorList.addItem(LangTool.getString("sa.hexAttrColor")); jcc = new JColorChooser(); // set the default color for display as that being for back ground jcc.setColor(getColorProperty("colorBg")); colorList.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JComboBox cb = (JComboBox)e.getSource(); String newSelection = (String)cb.getSelectedItem(); updateColorSelection(newSelection); } }); cp.add(colorList,BorderLayout.NORTH); cp.add(jcc,BorderLayout.CENTER); cpp.add(cschp,BorderLayout.NORTH); cpp.add(cp,BorderLayout.CENTER); // define display panel final JPanel display = new JPanel(); display.setLayout(new BoxLayout(display,BoxLayout.Y_AXIS)); // define column separator panel JPanel csp = new JPanel(); tb = BorderFactory.createTitledBorder(LangTool.getString("sa.cs")); csp.setBorder(tb); csLine = new JRadioButton(LangTool.getString("sa.csLine")); csLine.setActionCommand("Line"); csDot = new JRadioButton(LangTool.getString("sa.csDot")); csDot.setActionCommand("Dot"); csShortLine = new JRadioButton(LangTool.getString("sa.csShortLine")); csShortLine.setActionCommand("ShortLine"); // Group the radio buttons. ButtonGroup csGroup = new ButtonGroup(); csGroup.add(csLine); csGroup.add(csDot); csGroup.add(csShortLine); if (getStringProperty("colSeparator").equals("Dot")) csDot.setSelected(true); else if (getStringProperty("colSeparator").equals("ShortLine")) csShortLine.setSelected(true); else csLine.setSelected(true); csp.add(csLine); csp.add(csDot); csp.add(csShortLine); // define show attributs panel JPanel sap = new JPanel(); sap.setBorder( BorderFactory.createTitledBorder(LangTool.getString("sa.showAttr"))); saNormal = new JRadioButton(LangTool.getString("sa.showNormal")); saNormal.setActionCommand("Normal"); JRadioButton saHex = new JRadioButton(LangTool.getString("sa.showHex")); saHex.setActionCommand("Hex"); // Group the radio buttons. ButtonGroup saGroup = new ButtonGroup(); saGroup.add(saNormal); saGroup.add(saHex); if (getStringProperty("showAttr").equals("Hex")) saHex.setSelected(true); else saNormal.setSelected(true); sap.add(saNormal); sap.add(saHex); // define gui panel JPanel cgp = new JPanel(); cgp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.cgp"))); cgp.setLayout(new AlignLayout(1,5,5));// cgp.setLayout(new BoxLayout(cgp,BoxLayout.Y_AXIS)); guiCheck = new JCheckBox(LangTool.getString("sa.guiCheck")); guiShowUnderline = new JCheckBox(LangTool.getString("sa.guiShowUnderline")); if (getStringProperty("guiInterface").equals("Yes")) guiCheck.setSelected(true); // since this is a new property added then it might not exist in existing // profiles and it should be defaulted to yes. String under = getStringProperty("guiShowUnderline"); if (under.equals("Yes") || under.length() == 0) guiShowUnderline.setSelected(true); cgp.add(guiCheck); cgp.add(guiShowUnderline); display.add(csp); display.add(sap); display.add(cgp); // define cursor panel final JPanel cuPanel = new JPanel(); cuPanel.setLayout(new BoxLayout(cuPanel,BoxLayout.Y_AXIS)); // define cursor size panel JPanel crp = new JPanel(); crp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.crsSize"))); cFull = new JRadioButton(LangTool.getString("sa.cFull")); cHalf = new JRadioButton(LangTool.getString("sa.cHalf")); cLine = new JRadioButton(LangTool.getString("sa.cLine")); // Group the radio buttons. ButtonGroup cGroup = new ButtonGroup(); cGroup.add(cFull); cGroup.add(cHalf); cGroup.add(cLine); int cursorSize = 0; if (getStringProperty("cursorSize").equals("Full")) cursorSize = 2; if (getStringProperty("cursorSize").equals("Half")) cursorSize = 1; switch (cursorSize) { case 0: cLine.setSelected(true); break; case 1: cHalf.setSelected(true); break; case 2: cFull.setSelected(true); break; } crp.add(cFull); crp.add(cHalf); crp.add(cLine); // define cursor ruler panel JPanel chp = new JPanel(); chp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.crossHair"))); chNone = new JRadioButton(LangTool.getString("sa.chNone")); chHorz = new JRadioButton(LangTool.getString("sa.chHorz")); chVert = new JRadioButton(LangTool.getString("sa.chVert")); chCross = new JRadioButton(LangTool.getString("sa.chCross")); // Group the radio buttons. ButtonGroup chGroup = new ButtonGroup(); chGroup.add(chNone); chGroup.add(chHorz); chGroup.add(chVert); chGroup.add(chCross); int crossHair = 0; if (getStringProperty("crossHair").equals("Horz")) crossHair = 1; if (getStringProperty("crossHair").equals("Vert")) crossHair = 2; if (getStringProperty("crossHair").equals("Both")) crossHair = 3; switch (crossHair) { case 0: chNone.setSelected(true); break; case 1: chHorz.setSelected(true); break; case 2: chVert.setSelected(true); break; case 3: chCross.setSelected(true); break; } chp.add(chNone); chp.add(chHorz); chp.add(chVert); chp.add(chCross); // define double click as enter JPanel rulerFPanel = new JPanel(); rulerFPanel.setBorder(BorderFactory.createTitledBorder("")); rulerFixed = new JCheckBox(LangTool.getString("sa.rulerFixed")); rulerFPanel.add(rulerFixed); // define double click as enter JPanel bottOffPanel = new JPanel(); bottOffPanel.setBorder(BorderFactory.createTitledBorder( LangTool.getString("sa.curBottOffset"))); cursorBottOffset = new JTextField(5); try { int i = Integer.parseInt(getStringProperty("cursorBottOffset","0")); cursorBottOffset.setText(Integer.toString(i)); } catch (NumberFormatException ne) { cursorBottOffset.setText("0"); } bottOffPanel.add(cursorBottOffset); cuPanel.add(crp); cuPanel.add(chp); cuPanel.add(rulerFPanel); cuPanel.add(bottOffPanel); // define onConnect panel final JPanel onConnect = new JPanel(); onConnect.setLayout(new BoxLayout(onConnect,BoxLayout.Y_AXIS)); // define onConnect macro to run JPanel ocMacrop = new JPanel(); ocMacrop.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.connectMacro"))); connectMacro = new JTextField(); connectMacro.setColumns(30); // check if double click sends enter connectMacro.setText(getStringProperty("connectMacro")); ocMacrop.add(connectMacro); onConnect.add(ocMacrop); // define mouse panel final JPanel mouse = new JPanel(); mouse.setLayout(new BoxLayout(mouse,BoxLayout.Y_AXIS)); // define double click as enter JPanel dcep = new JPanel(); dcep.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.doubleClick"))); dceCheck = new JCheckBox(LangTool.getString("sa.sendEnter")); // check if double click sends enter dceCheck.setSelected(getStringProperty("doubleClick").equals("Yes")); dcep.add(dceCheck); mouse.add(dcep); // define hotspot panel final JPanel hotspot = new JPanel(); hotspot.setLayout(new BoxLayout(hotspot,BoxLayout.Y_AXIS)); // define hsPanel panel JPanel hsp = new JPanel(); hsp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.hsp"))); hsCheck = new JCheckBox(LangTool.getString("sa.hsCheck")); if (getStringProperty("hotspots").equals("Yes")) hsCheck.setSelected(true); hsp.add(hsCheck); // define assignment panel JPanel hsap = new JPanel(); hsap.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.hsap"))); hsap.setLayout(new GridLayout(2,2)); JLabel moreLabel = new JLabel(LangTool.getString("sa.hsMore")); JLabel bottomLabel = new JLabel(LangTool.getString("sa.hsBottom")); hsMore = new JTextField(getStringProperty("hsMore")); hsBottom = new JTextField(getStringProperty("hsBottom")); hsap.add(moreLabel); hsap.add(hsMore); hsap.add(bottomLabel); hsap.add(hsBottom); hotspot.add(hsp); hotspot.add(hsap); // define Key Pad panel final JPanel kp = new JPanel(); kp.setLayout(new BoxLayout(kp,BoxLayout.Y_AXIS)); // define kpPanel panel JPanel kpp = new JPanel(); kpp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.kpp"))); kpCheck = new JCheckBox(LangTool.getString("sa.kpCheck")); if (getStringProperty("keypad").equals("Yes")) kpCheck.setSelected(true); kpp.add(kpCheck); kp.add(kpp); // define default final JPanel jp = new JPanel(); jp.add(cpp,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); //Create the nodes. DefaultMutableTreeNode top = new DefaultMutableTreeNode(fileName); createNodes(top); //Create a tree that allows one selection at a time. final JTree tree = new JTree(top); tree.getSelectionModel().setSelectionMode (TreeSelectionModel.SINGLE_TREE_SELECTION); //Listen for when the selection changes. tree.addTreeSelectionListener(new TreeSelectionListener() { public void valueChanged(TreeSelectionEvent e) { DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent(); if (node == null) return; Object nodeInfo = node.getUserObject(); if (nodeInfo.toString().equals(LangTool.getString("sa.nodeFonts"))) { jp.removeAll(); jp.add(fp,BorderLayout.NORTH); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeColors"))) { jp.removeAll(); jp.add(cpp,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeDisplay"))) { jp.removeAll(); jp.add(display,BorderLayout.NORTH); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeCursor"))) { jp.removeAll(); jp.add(cuPanel,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeOnConnect"))) { jp.removeAll(); jp.add(onConnect,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeMouse"))) { jp.removeAll(); jp.add(mouse,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeHS"))) { jp.removeAll(); jp.add(hotspot,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeKP"))) { jp.removeAll(); jp.add(kp,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } } }); // define tree selection panel JPanel jsp = new JPanel(); jsp.setBackground(Color.white); jsp.add(tree); jpm.add(jp,BorderLayout.EAST); jpm.add(jsp,BorderLayout.WEST); } |
|
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 (newSelection.equals(LangTool.getString("sa.pink"))) { jcc.setColor(getColorProperty("colorPink")); } if (newSelection.equals(LangTool.getString("sa.green"))) { jcc.setColor(getColorProperty("colorGreen")); } if (newSelection.equals(LangTool.getString("sa.turq"))) { jcc.setColor(getColorProperty("colorTurq")); } if (newSelection.equals(LangTool.getString("sa.yellow"))) { jcc.setColor(getColorProperty("colorYellow")); } if (newSelection.equals(LangTool.getString("sa.white"))) { jcc.setColor(getColorProperty("colorWhite")); } if (newSelection.equals(LangTool.getString("sa.guiField"))) { jcc.setColor(getColorProperty("colorGUIField",Color.white)); } if (newSelection.equals(LangTool.getString("sa.cursorColor"))) { jcc.setColor(getColorProperty("colorCursor", getColorProperty("colorBg"))); } if (newSelection.equals(LangTool.getString("sa.columnSep"))) { jcc.setColor(getColorProperty("colorSep", getColorProperty("colorWhite"))); } if (newSelection.equals(LangTool.getString("sa.hexAttrColor"))) { jcc.setColor(getColorProperty("colorHexAttr", getColorProperty("colorWhite"))); } | 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.toString().equals(LangTool.getString("sa.nodeFonts"))) { jp.removeAll(); jp.add(fp,BorderLayout.NORTH); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeColors"))) { jp.removeAll(); jp.add(cpp,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeDisplay"))) { jp.removeAll(); jp.add(display,BorderLayout.NORTH); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeCursor"))) { jp.removeAll(); jp.add(cuPanel,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeOnConnect"))) { jp.removeAll(); jp.add(onConnect,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeMouse"))) { jp.removeAll(); jp.add(mouse,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeHS"))) { jp.removeAll(); jp.add(hotspot,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeKP"))) { jp.removeAll(); jp.add(kp,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } } |
|
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) dp = m_orb.rootPOA; try { return dp.servant_to_reference(this); } catch (WrongPolicy unexp) { BAD_OPERATION bad = new BAD_OPERATION(); bad.initCause(unexp); throw bad; } catch (ServantNotActive ex) { try { return dp.id_to_reference(dp.activate_object(this)); } catch (Exception unexp) { unexp.initCause(ex); BAD_OPERATION bad = new BAD_OPERATION(); bad.initCause(unexp); throw bad; } } } } throw new OBJECT_NOT_EXIST(); } |
|
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 = MetalLookAndFeel.getControlShadow(); Color light = MetalLookAndFeel.getWhite(); Color middle = MetalLookAndFeel.getControl(); // draw dark border g.setColor(darkShadow); g.drawRect(x, y, w - 2, h - 2); if (!bmodel.isPressed()) { // draw light border g.setColor(light); g.drawRect(x + 1, y + 1, w - 2, h - 2); // draw crossing pixels of both borders g.setColor(middle); g.drawRect(x + 1, y + h - 2, 0, 0); g.drawRect(x + w - 2, y + 1, 0, 0); } else { // draw light border 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); // draw shadow border g.setColor(middle); g.drawLine(x + 1, y + 1, x + w - 2, y + 1); g.drawLine(x + 1, y + 1, x + 1, y + h - 2); // draw crossing pixels of both borders g.setColor(shadow); g.drawRect(x + 1, y + h - 2, 0, 0); g.drawRect(x + w - 2, y + 1, 0, 0); } } |
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.setColor(middle); g.drawLine(x + 1, y + 1, x + w - 2, y + 1); g.drawLine(x + 1, y + 1, x + 1, y + h - 2); g.setColor(shadow); g.drawRect(x + 1, y + h - 2, 0, 0); g.drawRect(x + w - 2, y + 1, 0, 0); } } else | 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 = MetalLookAndFeel.getControlShadow(); Color light = MetalLookAndFeel.getWhite(); Color middle = MetalLookAndFeel.getControl(); // draw dark border g.setColor(darkShadow); g.drawRect(x, y, w - 2, h - 2); if (!bmodel.isPressed()) { // draw light border g.setColor(light); g.drawRect(x + 1, y + 1, w - 2, h - 2); // draw crossing pixels of both borders g.setColor(middle); g.drawRect(x + 1, y + h - 2, 0, 0); g.drawRect(x + w - 2, y + 1, 0, 0); } else { // draw light border 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); // draw shadow border g.setColor(middle); g.drawLine(x + 1, y + 1, x + w - 2, y + 1); g.drawLine(x + 1, y + 1, x + 1, y + h - 2); // draw crossing pixels of both borders g.setColor(shadow); g.drawRect(x + 1, y + h - 2, 0, 0); g.drawRect(x + w - 2, y + 1, 0, 0); } } |
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 + 1, y + 1, x + w - 2, y + 1); g.drawLine(x + 1, y + 1, x + 1, y + h - 2); g.setColor(shadow); g.drawRect(x + 1, y + h - 2, 0, 0); g.drawRect(x + w - 2, y + 1, 0, 0); | 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 = MetalLookAndFeel.getControlShadow(); Color light = MetalLookAndFeel.getWhite(); Color middle = MetalLookAndFeel.getControl(); // draw dark border g.setColor(darkShadow); g.drawRect(x, y, w - 2, h - 2); if (!bmodel.isPressed()) { // draw light border g.setColor(light); g.drawRect(x + 1, y + 1, w - 2, h - 2); // draw crossing pixels of both borders g.setColor(middle); g.drawRect(x + 1, y + h - 2, 0, 0); g.drawRect(x + w - 2, y + 1, 0, 0); } else { // draw light border 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); // draw shadow border g.setColor(middle); g.drawLine(x + 1, y + 1, x + w - 2, y + 1); g.drawLine(x + 1, y + 1, x + 1, y + h - 2); // draw crossing pixels of both borders g.setColor(shadow); g.drawRect(x + 1, y + h - 2, 0, 0); g.drawRect(x + w - 2, y + 1, 0, 0); } } |
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()); // fill the border background g.fillRect(x, y, w, 5); g.fillRect(x, y, 5, h); g.fillRect(x + w - 5, y, 5, h); g.fillRect(x, y + h - 5, w, 5); // draw a dot in each corner g.setColor(MetalLookAndFeel.getControl()); g.fillRect(x, y, 1, 1); g.fillRect(x + w - 1, y, 1, 1); g.fillRect(x + w - 1, y + h - 1, 1, 1); g.fillRect(x, y + h - 1, 1, 1); // draw the lines g.setColor(MetalLookAndFeel.getBlack()); g.drawLine(x + 14, y + 2, x + w - 15, y + 2); g.drawLine(x + 14, y + h - 3, x + w - 15, y + h - 3); g.drawLine(x + 2, y + 14, x + 2, y + h - 15); g.drawLine(x + w - 3, y + 14, x + w - 3, y + h - 15); // draw the line highlights g.setColor(MetalLookAndFeel.getControl()); g.drawLine(x + 15, y + 3, x + w - 14, y + 3); g.drawLine(x + 15, y + h - 2, x + w - 14, y + h - 2); g.drawLine(x + 3, y + 15, x + 3, y + h - 14); g.drawLine(x + w - 2, y + 15, x + w - 2, y + h - 14); } |
{ 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, h - 1); g.setColor(savedColor); } } |
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 implementation does close_action = DO_NOTHING_ON_CLOSE; } |
|
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 implementation does close_action = DO_NOTHING_ON_CLOSE; } |
|
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"); bad.initCause(cex); throw bad; } } |
|
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) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_RESIZED); getToolkit().getSystemEventQueue().postEvent(ce); } if (moved) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_MOVED); getToolkit().getSystemEventQueue().postEvent(ce); } } |
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) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_RESIZED); getToolkit().getSystemEventQueue().postEvent(ce); } if (moved) { ComponentEvent ce = new ComponentEvent(this, ComponentEvent.COMPONENT_MOVED); getToolkit().getSystemEventQueue().postEvent(ce); } } |
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 configuration file [" + configFileName+ "]."); System.err.println("Ignoring configuration file [" + configFileName+"]."); System.err.println("using default config"); defaultConfig(); return; } // If we reach here, then the config file is alright. System.out.println("Reading configuration."); configure(props); } |
|
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.