rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
|
---|---|---|
contentPane.add(blinkPanel); | public void initPanel() throws Exception { setLayout(new BorderLayout()); contentPane = new JPanel(); contentPane.setLayout(new BoxLayout(contentPane,BoxLayout.Y_AXIS)); add(contentPane,BorderLayout.NORTH); // 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")); rulerFixed.setSelected(true); if (getStringProperty("rulerFixed").equals("Yes")) rulerFixed.setSelected(false); rulerFPanel.add(rulerFixed); // define bottom offset panel for cursor 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); contentPane.add(crp); contentPane.add(chp); contentPane.add(rulerFPanel); contentPane.add(bottOffPanel); } |
|
if (!evt.isShiftDown()) | if (evt.getModifiers() == 0) | public void keyPressed( KeyEvent evt ) { int lead = BasicListUI.this.list.getLeadSelectionIndex(); int max = BasicListUI.this.list.getModel().getSize() - 1; // Do nothing if list is empty if (max == -1) return; // Process the key event. Bindings can be found in // javax.swing.plaf.basic.BasicLookAndFeel.java if ((evt.getKeyCode() == KeyEvent.VK_DOWN) || (evt.getKeyCode() == KeyEvent.VK_KP_DOWN)) { if (!evt.isShiftDown()) { BasicListUI.this.list.clearSelection(); BasicListUI.this.list.setSelectedIndex(Math.min(lead+1,max)); } else { BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.min(lead+1,max)); } } else if ((evt.getKeyCode() == KeyEvent.VK_UP) || (evt.getKeyCode() == KeyEvent.VK_KP_UP)) { if (!evt.isShiftDown()) { BasicListUI.this.list.clearSelection(); BasicListUI.this.list.setSelectedIndex(Math.max(lead-1,0)); } else { BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.max(lead-1,0)); } } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_UP) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_DOWN) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_BACK_SLASH && evt.isControlDown()) { BasicListUI.this.list.clearSelection(); } else if ((evt.getKeyCode() == KeyEvent.VK_HOME) || evt.getKeyCode() == KeyEvent.VK_END) { // index is either 0 for HOME, or last cell for END int index = (evt.getKeyCode() == KeyEvent.VK_HOME) ? 0 : max; if (!evt.isShiftDown() ||(BasicListUI.this.list.getSelectionMode() == ListSelectionModel.SINGLE_SELECTION)) BasicListUI.this.list.setSelectedIndex(index); else if (BasicListUI.this.list.getSelectionMode() == ListSelectionModel.SINGLE_INTERVAL_SELECTION) BasicListUI.this.list.setSelectionInterval (BasicListUI.this.list.getAnchorSelectionIndex(), index); else BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(index); } else if ((evt.getKeyCode() == KeyEvent.VK_A || evt.getKeyCode() == KeyEvent.VK_SLASH) && evt.isControlDown()) { BasicListUI.this.list.setSelectionInterval(0, max); // this next line is to restore the lead selection index to the old // position, because select-all should not change the lead index BasicListUI.this.list.addSelectionInterval(lead, lead); } else if (evt.getKeyCode() == KeyEvent.VK_SPACE && evt.isControlDown()) { BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.min(lead+1,max)); } } |
else | else if (evt.getModifiers() == InputEvent.SHIFT_MASK) | public void keyPressed( KeyEvent evt ) { int lead = BasicListUI.this.list.getLeadSelectionIndex(); int max = BasicListUI.this.list.getModel().getSize() - 1; // Do nothing if list is empty if (max == -1) return; // Process the key event. Bindings can be found in // javax.swing.plaf.basic.BasicLookAndFeel.java if ((evt.getKeyCode() == KeyEvent.VK_DOWN) || (evt.getKeyCode() == KeyEvent.VK_KP_DOWN)) { if (!evt.isShiftDown()) { BasicListUI.this.list.clearSelection(); BasicListUI.this.list.setSelectedIndex(Math.min(lead+1,max)); } else { BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.min(lead+1,max)); } } else if ((evt.getKeyCode() == KeyEvent.VK_UP) || (evt.getKeyCode() == KeyEvent.VK_KP_UP)) { if (!evt.isShiftDown()) { BasicListUI.this.list.clearSelection(); BasicListUI.this.list.setSelectedIndex(Math.max(lead-1,0)); } else { BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.max(lead-1,0)); } } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_UP) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_DOWN) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_BACK_SLASH && evt.isControlDown()) { BasicListUI.this.list.clearSelection(); } else if ((evt.getKeyCode() == KeyEvent.VK_HOME) || evt.getKeyCode() == KeyEvent.VK_END) { // index is either 0 for HOME, or last cell for END int index = (evt.getKeyCode() == KeyEvent.VK_HOME) ? 0 : max; if (!evt.isShiftDown() ||(BasicListUI.this.list.getSelectionMode() == ListSelectionModel.SINGLE_SELECTION)) BasicListUI.this.list.setSelectedIndex(index); else if (BasicListUI.this.list.getSelectionMode() == ListSelectionModel.SINGLE_INTERVAL_SELECTION) BasicListUI.this.list.setSelectionInterval (BasicListUI.this.list.getAnchorSelectionIndex(), index); else BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(index); } else if ((evt.getKeyCode() == KeyEvent.VK_A || evt.getKeyCode() == KeyEvent.VK_SLASH) && evt.isControlDown()) { BasicListUI.this.list.setSelectionInterval(0, max); // this next line is to restore the lead selection index to the old // position, because select-all should not change the lead index BasicListUI.this.list.addSelectionInterval(lead, lead); } else if (evt.getKeyCode() == KeyEvent.VK_SPACE && evt.isControlDown()) { BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.min(lead+1,max)); } } |
int target; if (lead == BasicListUI.this.list.getFirstVisibleIndex()) { target = Math.max (0, lead - (BasicListUI.this.list.getLastVisibleIndex() - BasicListUI.this.list.getFirstVisibleIndex() + 1)); } else { target = BasicListUI.this.list.getFirstVisibleIndex(); } if (evt.getModifiers() == 0) BasicListUI.this.list.setSelectedIndex(target); else if (evt.getModifiers() == InputEvent.SHIFT_MASK) BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(target); | public void keyPressed( KeyEvent evt ) { int lead = BasicListUI.this.list.getLeadSelectionIndex(); int max = BasicListUI.this.list.getModel().getSize() - 1; // Do nothing if list is empty if (max == -1) return; // Process the key event. Bindings can be found in // javax.swing.plaf.basic.BasicLookAndFeel.java if ((evt.getKeyCode() == KeyEvent.VK_DOWN) || (evt.getKeyCode() == KeyEvent.VK_KP_DOWN)) { if (!evt.isShiftDown()) { BasicListUI.this.list.clearSelection(); BasicListUI.this.list.setSelectedIndex(Math.min(lead+1,max)); } else { BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.min(lead+1,max)); } } else if ((evt.getKeyCode() == KeyEvent.VK_UP) || (evt.getKeyCode() == KeyEvent.VK_KP_UP)) { if (!evt.isShiftDown()) { BasicListUI.this.list.clearSelection(); BasicListUI.this.list.setSelectedIndex(Math.max(lead-1,0)); } else { BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.max(lead-1,0)); } } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_UP) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_DOWN) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_BACK_SLASH && evt.isControlDown()) { BasicListUI.this.list.clearSelection(); } else if ((evt.getKeyCode() == KeyEvent.VK_HOME) || evt.getKeyCode() == KeyEvent.VK_END) { // index is either 0 for HOME, or last cell for END int index = (evt.getKeyCode() == KeyEvent.VK_HOME) ? 0 : max; if (!evt.isShiftDown() ||(BasicListUI.this.list.getSelectionMode() == ListSelectionModel.SINGLE_SELECTION)) BasicListUI.this.list.setSelectedIndex(index); else if (BasicListUI.this.list.getSelectionMode() == ListSelectionModel.SINGLE_INTERVAL_SELECTION) BasicListUI.this.list.setSelectionInterval (BasicListUI.this.list.getAnchorSelectionIndex(), index); else BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(index); } else if ((evt.getKeyCode() == KeyEvent.VK_A || evt.getKeyCode() == KeyEvent.VK_SLASH) && evt.isControlDown()) { BasicListUI.this.list.setSelectionInterval(0, max); // this next line is to restore the lead selection index to the old // position, because select-all should not change the lead index BasicListUI.this.list.addSelectionInterval(lead, lead); } else if (evt.getKeyCode() == KeyEvent.VK_SPACE && evt.isControlDown()) { BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.min(lead+1,max)); } } |
|
int target; if (lead == BasicListUI.this.list.getLastVisibleIndex()) { target = Math.min (max, lead + (BasicListUI.this.list.getLastVisibleIndex() - BasicListUI.this.list.getFirstVisibleIndex() + 1)); } else { target = BasicListUI.this.list.getLastVisibleIndex(); } if (evt.getModifiers() == 0) BasicListUI.this.list.setSelectedIndex(target); else if (evt.getModifiers() == InputEvent.SHIFT_MASK) BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(target); | public void keyPressed( KeyEvent evt ) { int lead = BasicListUI.this.list.getLeadSelectionIndex(); int max = BasicListUI.this.list.getModel().getSize() - 1; // Do nothing if list is empty if (max == -1) return; // Process the key event. Bindings can be found in // javax.swing.plaf.basic.BasicLookAndFeel.java if ((evt.getKeyCode() == KeyEvent.VK_DOWN) || (evt.getKeyCode() == KeyEvent.VK_KP_DOWN)) { if (!evt.isShiftDown()) { BasicListUI.this.list.clearSelection(); BasicListUI.this.list.setSelectedIndex(Math.min(lead+1,max)); } else { BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.min(lead+1,max)); } } else if ((evt.getKeyCode() == KeyEvent.VK_UP) || (evt.getKeyCode() == KeyEvent.VK_KP_UP)) { if (!evt.isShiftDown()) { BasicListUI.this.list.clearSelection(); BasicListUI.this.list.setSelectedIndex(Math.max(lead-1,0)); } else { BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.max(lead-1,0)); } } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_UP) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_DOWN) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_BACK_SLASH && evt.isControlDown()) { BasicListUI.this.list.clearSelection(); } else if ((evt.getKeyCode() == KeyEvent.VK_HOME) || evt.getKeyCode() == KeyEvent.VK_END) { // index is either 0 for HOME, or last cell for END int index = (evt.getKeyCode() == KeyEvent.VK_HOME) ? 0 : max; if (!evt.isShiftDown() ||(BasicListUI.this.list.getSelectionMode() == ListSelectionModel.SINGLE_SELECTION)) BasicListUI.this.list.setSelectedIndex(index); else if (BasicListUI.this.list.getSelectionMode() == ListSelectionModel.SINGLE_INTERVAL_SELECTION) BasicListUI.this.list.setSelectionInterval (BasicListUI.this.list.getAnchorSelectionIndex(), index); else BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(index); } else if ((evt.getKeyCode() == KeyEvent.VK_A || evt.getKeyCode() == KeyEvent.VK_SLASH) && evt.isControlDown()) { BasicListUI.this.list.setSelectionInterval(0, max); // this next line is to restore the lead selection index to the old // position, because select-all should not change the lead index BasicListUI.this.list.addSelectionInterval(lead, lead); } else if (evt.getKeyCode() == KeyEvent.VK_SPACE && evt.isControlDown()) { BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.min(lead+1,max)); } } |
|
&& evt.isControlDown()) | && (evt.getModifiers() == InputEvent.CTRL_MASK)) | public void keyPressed( KeyEvent evt ) { int lead = BasicListUI.this.list.getLeadSelectionIndex(); int max = BasicListUI.this.list.getModel().getSize() - 1; // Do nothing if list is empty if (max == -1) return; // Process the key event. Bindings can be found in // javax.swing.plaf.basic.BasicLookAndFeel.java if ((evt.getKeyCode() == KeyEvent.VK_DOWN) || (evt.getKeyCode() == KeyEvent.VK_KP_DOWN)) { if (!evt.isShiftDown()) { BasicListUI.this.list.clearSelection(); BasicListUI.this.list.setSelectedIndex(Math.min(lead+1,max)); } else { BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.min(lead+1,max)); } } else if ((evt.getKeyCode() == KeyEvent.VK_UP) || (evt.getKeyCode() == KeyEvent.VK_KP_UP)) { if (!evt.isShiftDown()) { BasicListUI.this.list.clearSelection(); BasicListUI.this.list.setSelectedIndex(Math.max(lead-1,0)); } else { BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.max(lead-1,0)); } } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_UP) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_DOWN) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_BACK_SLASH && evt.isControlDown()) { BasicListUI.this.list.clearSelection(); } else if ((evt.getKeyCode() == KeyEvent.VK_HOME) || evt.getKeyCode() == KeyEvent.VK_END) { // index is either 0 for HOME, or last cell for END int index = (evt.getKeyCode() == KeyEvent.VK_HOME) ? 0 : max; if (!evt.isShiftDown() ||(BasicListUI.this.list.getSelectionMode() == ListSelectionModel.SINGLE_SELECTION)) BasicListUI.this.list.setSelectedIndex(index); else if (BasicListUI.this.list.getSelectionMode() == ListSelectionModel.SINGLE_INTERVAL_SELECTION) BasicListUI.this.list.setSelectionInterval (BasicListUI.this.list.getAnchorSelectionIndex(), index); else BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(index); } else if ((evt.getKeyCode() == KeyEvent.VK_A || evt.getKeyCode() == KeyEvent.VK_SLASH) && evt.isControlDown()) { BasicListUI.this.list.setSelectionInterval(0, max); // this next line is to restore the lead selection index to the old // position, because select-all should not change the lead index BasicListUI.this.list.addSelectionInterval(lead, lead); } else if (evt.getKeyCode() == KeyEvent.VK_SPACE && evt.isControlDown()) { BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.min(lead+1,max)); } } |
== KeyEvent.VK_SLASH) && evt.isControlDown()) | == KeyEvent.VK_SLASH) && (evt.getModifiers() == InputEvent.CTRL_MASK)) | public void keyPressed( KeyEvent evt ) { int lead = BasicListUI.this.list.getLeadSelectionIndex(); int max = BasicListUI.this.list.getModel().getSize() - 1; // Do nothing if list is empty if (max == -1) return; // Process the key event. Bindings can be found in // javax.swing.plaf.basic.BasicLookAndFeel.java if ((evt.getKeyCode() == KeyEvent.VK_DOWN) || (evt.getKeyCode() == KeyEvent.VK_KP_DOWN)) { if (!evt.isShiftDown()) { BasicListUI.this.list.clearSelection(); BasicListUI.this.list.setSelectedIndex(Math.min(lead+1,max)); } else { BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.min(lead+1,max)); } } else if ((evt.getKeyCode() == KeyEvent.VK_UP) || (evt.getKeyCode() == KeyEvent.VK_KP_UP)) { if (!evt.isShiftDown()) { BasicListUI.this.list.clearSelection(); BasicListUI.this.list.setSelectedIndex(Math.max(lead-1,0)); } else { BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.max(lead-1,0)); } } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_UP) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_DOWN) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_BACK_SLASH && evt.isControlDown()) { BasicListUI.this.list.clearSelection(); } else if ((evt.getKeyCode() == KeyEvent.VK_HOME) || evt.getKeyCode() == KeyEvent.VK_END) { // index is either 0 for HOME, or last cell for END int index = (evt.getKeyCode() == KeyEvent.VK_HOME) ? 0 : max; if (!evt.isShiftDown() ||(BasicListUI.this.list.getSelectionMode() == ListSelectionModel.SINGLE_SELECTION)) BasicListUI.this.list.setSelectedIndex(index); else if (BasicListUI.this.list.getSelectionMode() == ListSelectionModel.SINGLE_INTERVAL_SELECTION) BasicListUI.this.list.setSelectionInterval (BasicListUI.this.list.getAnchorSelectionIndex(), index); else BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(index); } else if ((evt.getKeyCode() == KeyEvent.VK_A || evt.getKeyCode() == KeyEvent.VK_SLASH) && evt.isControlDown()) { BasicListUI.this.list.setSelectionInterval(0, max); // this next line is to restore the lead selection index to the old // position, because select-all should not change the lead index BasicListUI.this.list.addSelectionInterval(lead, lead); } else if (evt.getKeyCode() == KeyEvent.VK_SPACE && evt.isControlDown()) { BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.min(lead+1,max)); } } |
else if (evt.getKeyCode() == KeyEvent.VK_SPACE && evt.isControlDown()) | else if (evt.getKeyCode() == KeyEvent.VK_SPACE && (evt.getModifiers() == InputEvent.CTRL_MASK)) | public void keyPressed( KeyEvent evt ) { int lead = BasicListUI.this.list.getLeadSelectionIndex(); int max = BasicListUI.this.list.getModel().getSize() - 1; // Do nothing if list is empty if (max == -1) return; // Process the key event. Bindings can be found in // javax.swing.plaf.basic.BasicLookAndFeel.java if ((evt.getKeyCode() == KeyEvent.VK_DOWN) || (evt.getKeyCode() == KeyEvent.VK_KP_DOWN)) { if (!evt.isShiftDown()) { BasicListUI.this.list.clearSelection(); BasicListUI.this.list.setSelectedIndex(Math.min(lead+1,max)); } else { BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.min(lead+1,max)); } } else if ((evt.getKeyCode() == KeyEvent.VK_UP) || (evt.getKeyCode() == KeyEvent.VK_KP_UP)) { if (!evt.isShiftDown()) { BasicListUI.this.list.clearSelection(); BasicListUI.this.list.setSelectedIndex(Math.max(lead-1,0)); } else { BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.max(lead-1,0)); } } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_UP) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_DOWN) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_BACK_SLASH && evt.isControlDown()) { BasicListUI.this.list.clearSelection(); } else if ((evt.getKeyCode() == KeyEvent.VK_HOME) || evt.getKeyCode() == KeyEvent.VK_END) { // index is either 0 for HOME, or last cell for END int index = (evt.getKeyCode() == KeyEvent.VK_HOME) ? 0 : max; if (!evt.isShiftDown() ||(BasicListUI.this.list.getSelectionMode() == ListSelectionModel.SINGLE_SELECTION)) BasicListUI.this.list.setSelectedIndex(index); else if (BasicListUI.this.list.getSelectionMode() == ListSelectionModel.SINGLE_INTERVAL_SELECTION) BasicListUI.this.list.setSelectionInterval (BasicListUI.this.list.getAnchorSelectionIndex(), index); else BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(index); } else if ((evt.getKeyCode() == KeyEvent.VK_A || evt.getKeyCode() == KeyEvent.VK_SLASH) && evt.isControlDown()) { BasicListUI.this.list.setSelectionInterval(0, max); // this next line is to restore the lead selection index to the old // position, because select-all should not change the lead index BasicListUI.this.list.addSelectionInterval(lead, lead); } else if (evt.getKeyCode() == KeyEvent.VK_SPACE && evt.isControlDown()) { BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.min(lead+1,max)); } } |
BasicListUI.this.list.ensureIndexIsVisible (BasicListUI.this.list.getLeadSelectionIndex()); | public void keyPressed( KeyEvent evt ) { int lead = BasicListUI.this.list.getLeadSelectionIndex(); int max = BasicListUI.this.list.getModel().getSize() - 1; // Do nothing if list is empty if (max == -1) return; // Process the key event. Bindings can be found in // javax.swing.plaf.basic.BasicLookAndFeel.java if ((evt.getKeyCode() == KeyEvent.VK_DOWN) || (evt.getKeyCode() == KeyEvent.VK_KP_DOWN)) { if (!evt.isShiftDown()) { BasicListUI.this.list.clearSelection(); BasicListUI.this.list.setSelectedIndex(Math.min(lead+1,max)); } else { BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.min(lead+1,max)); } } else if ((evt.getKeyCode() == KeyEvent.VK_UP) || (evt.getKeyCode() == KeyEvent.VK_KP_UP)) { if (!evt.isShiftDown()) { BasicListUI.this.list.clearSelection(); BasicListUI.this.list.setSelectedIndex(Math.max(lead-1,0)); } else { BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.max(lead-1,0)); } } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_UP) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_DOWN) { // FIXME: implement, need JList.ensureIndexIsVisible to work } else if (evt.getKeyCode() == KeyEvent.VK_BACK_SLASH && evt.isControlDown()) { BasicListUI.this.list.clearSelection(); } else if ((evt.getKeyCode() == KeyEvent.VK_HOME) || evt.getKeyCode() == KeyEvent.VK_END) { // index is either 0 for HOME, or last cell for END int index = (evt.getKeyCode() == KeyEvent.VK_HOME) ? 0 : max; if (!evt.isShiftDown() ||(BasicListUI.this.list.getSelectionMode() == ListSelectionModel.SINGLE_SELECTION)) BasicListUI.this.list.setSelectedIndex(index); else if (BasicListUI.this.list.getSelectionMode() == ListSelectionModel.SINGLE_INTERVAL_SELECTION) BasicListUI.this.list.setSelectionInterval (BasicListUI.this.list.getAnchorSelectionIndex(), index); else BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(index); } else if ((evt.getKeyCode() == KeyEvent.VK_A || evt.getKeyCode() == KeyEvent.VK_SLASH) && evt.isControlDown()) { BasicListUI.this.list.setSelectionInterval(0, max); // this next line is to restore the lead selection index to the old // position, because select-all should not change the lead index BasicListUI.this.list.addSelectionInterval(lead, lead); } else if (evt.getKeyCode() == KeyEvent.VK_SPACE && evt.isControlDown()) { BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(Math.min(lead+1,max)); } } |
|
if (event.isControlDown()) { if (BasicListUI.this.list.getSelectionMode() == ListSelectionModel.SINGLE_SELECTION) BasicListUI.this.list.setSelectedIndex(index); else if (BasicListUI.this.list.isSelectedIndex(index)) BasicListUI.this.list.removeSelectionInterval(index,index); else BasicListUI.this.list.addSelectionInterval(index,index); } else if (event.isShiftDown()) | if (event.isShiftDown()) | public void mouseClicked(MouseEvent event) { Point click = event.getPoint(); int index = BasicListUI.this.locationToIndex(list, click); if (index == -1) return; if (event.isControlDown()) { if (BasicListUI.this.list.getSelectionMode() == ListSelectionModel.SINGLE_SELECTION) BasicListUI.this.list.setSelectedIndex(index); else if (BasicListUI.this.list.isSelectedIndex(index)) BasicListUI.this.list.removeSelectionInterval(index,index); else BasicListUI.this.list.addSelectionInterval(index,index); } else if (event.isShiftDown()) { if (BasicListUI.this.list.getSelectionMode() == ListSelectionModel.SINGLE_SELECTION) BasicListUI.this.list.setSelectedIndex(index); else if (BasicListUI.this.list.getSelectionMode() == ListSelectionModel.SINGLE_INTERVAL_SELECTION) // COMPAT: the IBM VM is compatible with the following line of code. // However, compliance with Sun's VM would correspond to replacing // getAnchorSelectionIndex() with getLeadSelectionIndex().This is // both unnatural and contradictory to the way they handle other // similar UI interactions. BasicListUI.this.list.setSelectionInterval (BasicListUI.this.list.getAnchorSelectionIndex(), index); else // COMPAT: both Sun and IBM are compatible instead with: // BasicListUI.this.list.setSelectionInterval // (BasicListUI.this.list.getLeadSelectionIndex(),index); // Note that for IBM this is contradictory to what they did in // the above situation for SINGLE_INTERVAL_SELECTION. // The most natural thing to do is the following: BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(index); } else BasicListUI.this.list.setSelectedIndex(index); } |
BasicListUI.this.list.ensureIndexIsVisible (BasicListUI.this.list.getLeadSelectionIndex()); | public void mouseClicked(MouseEvent event) { Point click = event.getPoint(); int index = BasicListUI.this.locationToIndex(list, click); if (index == -1) return; if (event.isControlDown()) { if (BasicListUI.this.list.getSelectionMode() == ListSelectionModel.SINGLE_SELECTION) BasicListUI.this.list.setSelectedIndex(index); else if (BasicListUI.this.list.isSelectedIndex(index)) BasicListUI.this.list.removeSelectionInterval(index,index); else BasicListUI.this.list.addSelectionInterval(index,index); } else if (event.isShiftDown()) { if (BasicListUI.this.list.getSelectionMode() == ListSelectionModel.SINGLE_SELECTION) BasicListUI.this.list.setSelectedIndex(index); else if (BasicListUI.this.list.getSelectionMode() == ListSelectionModel.SINGLE_INTERVAL_SELECTION) // COMPAT: the IBM VM is compatible with the following line of code. // However, compliance with Sun's VM would correspond to replacing // getAnchorSelectionIndex() with getLeadSelectionIndex().This is // both unnatural and contradictory to the way they handle other // similar UI interactions. BasicListUI.this.list.setSelectionInterval (BasicListUI.this.list.getAnchorSelectionIndex(), index); else // COMPAT: both Sun and IBM are compatible instead with: // BasicListUI.this.list.setSelectionInterval // (BasicListUI.this.list.getLeadSelectionIndex(),index); // Note that for IBM this is contradictory to what they did in // the above situation for SINGLE_INTERVAL_SELECTION. // The most natural thing to do is the following: BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(index); } else BasicListUI.this.list.setSelectedIndex(index); } |
|
size.width = columns * getColumnWidth(); | { Insets i = getInsets(); size.width = columns * getColumnWidth() + i.left + i.right; } | public Dimension getPreferredSize() { Dimension size = super.getPreferredSize(); if (columns != 0) size.width = columns * getColumnWidth(); return size; } |
if (clipboard != null) return clipboard; else { | private static Clipboard getClipboard(JComponent component) { // Avoid throwing exception if the system clipboard access failed // in the past. if (clipboard != null) return clipboard; else { try { SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkSystemClipboardAccess(); // We may access system clipboard. return component.getToolkit().getSystemClipboard(); } catch (Exception e) { // We may not access system clipboard. // Create VM-local clipboard if none exists yet. clipboard = new Clipboard("Clipboard"); return clipboard; } } } |
|
} | private static Clipboard getClipboard(JComponent component) { // Avoid throwing exception if the system clipboard access failed // in the past. if (clipboard != null) return clipboard; else { try { SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkSystemClipboardAccess(); // We may access system clipboard. return component.getToolkit().getSystemClipboard(); } catch (Exception e) { // We may not access system clipboard. // Create VM-local clipboard if none exists yet. clipboard = new Clipboard("Clipboard"); return clipboard; } } } |
|
InputStream stream) { super(stream); } | InputStream stream) { super(stream); int max = 0; try { max = stream.available(); } catch ( IOException ioe ) { } monitor = new ProgressMonitor( component, message, null, 0, max ); } | public ProgressMonitorInputStream(Component component, Object message, InputStream stream) { super(stream); // TODO } // ProgressMonitorInputStream() |
public void close() throws IOException { } | public void close() throws IOException { super.close(); monitor.close(); } | public void close() throws IOException { // TODO } // close() |
public ProgressMonitor getProgressMonitor() { return null; } | public ProgressMonitor getProgressMonitor() { return monitor; } | public ProgressMonitor getProgressMonitor() { return null; // TODO } // getProgressMonitor() |
public int read() throws IOException { return 0; } | public int read() throws IOException { int t = super.read(); monitor.setProgress(++read); checkMonitorCanceled(); return t; } | public int read() throws IOException { return 0; // TODO } // read() |
public synchronized void reset() throws IOException { } | public void reset() throws IOException { super.reset(); checkMonitorCanceled(); } | public synchronized void reset() throws IOException { // TODO } // reset() |
public long skip(long length) throws IOException { return 0; } | public long skip(long length) throws IOException { long t = super.skip(length); assert ( (long) read + t <= (long) Integer.MAX_VALUE ); read += (int) t; monitor.setProgress(read); checkMonitorCanceled(); return t; } | public long skip(long length) throws IOException { return 0; // TODO } // skip() |
CurrentArray.addNote(newnote); | getCurrentArray().addNote(newnote); } else if( parentNodeName.equals(XDFNodeName.STRUCTURE) || parentNodeName.equals(XDFNodeName.ROOT) ) { getCurrentStructure().addNote(newnote); | public Object action (SaxDocumentHandler handler, Attributes attrs) throws SAXException { String parentNodeName = getParentNodeName(); // create new object appropriately Note newnote = new Note(); newnote.setAttributes(attrs); // set XML attributes from passed list String noteId = newnote.getNoteId(); String noteIdRef = newnote.getNoteIdRef(); // add this object to the lookup table, if it has an ID if (noteId != null) { // a warning check, just in case if (NoteObj.containsKey(noteId)) Log.warnln("More than one note node with noteId=\""+noteId+"\", using latest node." ); // add this into the list of note objects NoteObj.put(noteId, newnote); } // If there is a reference object, clone it to get // the new axis if (noteIdRef != null) { if (NoteObj.containsKey(noteIdRef)) { BaseObject refNoteObj = (BaseObject) NoteObj.get(noteIdRef); try { newnote = (Note) refNoteObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone note object. Aborting read."); System.exit(-1); } // override attrs with those in passed list newnote.setAttributes(attrs); // give the clone a unique Id and remove IdRef newnote.setNoteId(findUniqueIdName(NoteObj, newnote.getNoteId())); newnote.setNoteIdRef(null); // add this into the list of note objects NoteObj.put(newnote.getNoteId(), newnote); } else { Log.warnln("Error: Reader got a note with NoteIdRef=\""+noteIdRef+"\" but no previous note has that id! Ignoring add note request."); return (Object) null; } } // add this object to parent object if( parentNodeName.equals(XDFNodeName.NOTES) ) { // only NOTES objects appear in arrays, so we can // just add to the current array CurrentArray.addNote(newnote); } else if ( parentNodeName.equals(XDFNodeName.FIELD) ) { LastFieldObject.addNote(newnote); } else if ( parentNodeName.equals(XDFNodeName.PARAMETER) ) { LastParameterObject.addNote(newnote); } else { Log.warnln( "Unknown parent node: "+parentNodeName+" for note. Ignoring."); } LastNoteObject = newnote; return newnote; } |
bad.minor = Minor.Any; | public static ObjectAlreadyActive extract(Any any) { try { EmptyExceptionHolder h = (EmptyExceptionHolder) any.extract_Streamable(); return (ObjectAlreadyActive) h.value; } catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("ObjectAlreadyActive expected"); bad.initCause(cex); throw bad; } } |
|
if (config.getStringProperty("cursorBlink").equals("Yes")) { blinker = new javax.swing.Timer(500,this); blinker.start(); } | public void loadProps() { loadColors(); if (config.isPropertyExists("colSeparator")) { if (getStringProperty("colSeparator").equals("Line")) colSepLine = 0; if (getStringProperty("colSeparator").equals("ShortLine")) colSepLine = 1; if (getStringProperty("colSeparator").equals("Dot")) colSepLine = 2; if (getStringProperty("colSeparator").equals("Hide")) colSepLine = 3; } if (config.isPropertyExists("showAttr")) { if (getStringProperty("showAttr").equals("Hex")) showHex = true; } if (config.isPropertyExists("guiInterface")) { if (getStringProperty("guiInterface").equals("Yes")) guiInterface = true; else guiInterface = false; } if (config.isPropertyExists("guiShowUnderline")) { if (getStringProperty("guiShowUnderline").equals("Yes")) guiShowUnderline = true; else guiShowUnderline = false; } if (config.isPropertyExists("hotspots")) { if (getStringProperty("hotspots").equals("Yes")) hotSpots = true; else hotSpots = false; } if (config.isPropertyExists("hsMore")) { if (getStringProperty("hsMore").length() > 0) { hsMore.setLength(0); hsMore.append(getStringProperty("hsMore")); } } if (config.isPropertyExists("hsBottom")) { if (getStringProperty("hsBottom").length() > 0) { hsBottom.setLength(0); hsBottom.append(getStringProperty("hsBottom")); } } if (config.isPropertyExists("colSeparator")) { if (getStringProperty("colSeparator").equals("Line")) colSepLine = 0; if (getStringProperty("colSeparator").equals("ShortLine")) colSepLine = 1; if (getStringProperty("colSeparator").equals("Dot")) colSepLine = 2; if (getStringProperty("colSeparator").equals("Hide")) colSepLine = 3; } if (config.isPropertyExists("cursorSize")) { if (getStringProperty("cursorSize").equals("Full")) cursorSize = 2; if (getStringProperty("cursorSize").equals("Half")) cursorSize = 1; if (getStringProperty("cursorSize").equals("Line")) cursorSize = 0; } if (config.isPropertyExists("crossHair")) { if (getStringProperty("crossHair").equals("None")) crossHair = 0; if (getStringProperty("crossHair").equals("Horz")) crossHair = 1; if (getStringProperty("crossHair").equals("Vert")) crossHair = 2; if (getStringProperty("crossHair").equals("Both")) crossHair = 3; } if (config.isPropertyExists("rulerFixed")) { if (getStringProperty("rulerFixed").equals("Yes")) rulerFixed = true; else rulerFixed = false; } if (config.isPropertyExists("fontScaleHeight")) { sfh = getFloatProperty("fontScaleHeight"); } if (config.isPropertyExists("fontScaleWidth")) { sfw = getFloatProperty("fontScaleWidth"); } if (config.isPropertyExists("fontPointSize")) { ps132 = getFloatProperty("fontPointSize"); } if (config.isPropertyExists("cursorBottOffset")) { cursorBottOffset = getIntProperty("cursorBottOffset"); } if (config.isPropertyExists("defaultPrinter")) { if (getStringProperty("defaultPrinter").equals("Yes")) defaultPrinter = true; else defaultPrinter = false; } if (config.isPropertyExists("resetRequired")) { if (getStringProperty("resetRequired").equals("Yes")) resetRequired = true; else resetRequired = false; } if (config.isPropertyExists("useAntialias")) { if (getStringProperty("useAntialias").equals("Yes")) antialiased = true; else antialiased = false; } } |
|
if (pn.equals("cursorBlink")) { System.out.println(getStringProperty("cursorBlink")); if (pce.getNewValue().equals("Yes")) { if (blinker == null) { blinker = new javax.swing.Timer(500,this); blinker.start(); } } else { if (blinker != null) { blinker.stop(); blinker = null; } } } | public void propertyChange(PropertyChangeEvent pce) { String pn = pce.getPropertyName(); boolean resetAttr = false; if (pn.equals("colorBg")) { colorBg = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorBlue")) { colorBlue = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorTurq")) { colorTurq = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorRed")) { colorRed = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorWhite")) { colorWhite = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorYellow")) { colorYellow = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorGreen")) { colorGreen = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorPink")) { colorPink = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorGUIField")) { colorGUIField = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorCursor")) { colorCursor = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorSep")) { colorSep = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorHexAttr")) { colorHexAttr = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("cursorSize")) { if (pce.getNewValue().equals("Full")) cursorSize = 2; if (pce.getNewValue().equals("Half")) cursorSize = 1; if (pce.getNewValue().equals("Line")) cursorSize = 0; } if (pn.equals("crossHair")) { if (pce.getNewValue().equals("None")) crossHair = 0; if (pce.getNewValue().equals("Horz")) crossHair = 1; if (pce.getNewValue().equals("Vert")) crossHair = 2; if (pce.getNewValue().equals("Both")) crossHair = 3; } if (pn.equals("rulerFixed")) { if (pce.getNewValue().equals("Yes")) rulerFixed = true; else rulerFixed = false; } if (pn.equals("colSeparator")) { if (pce.getNewValue().equals("Line")) colSepLine = 0; if (pce.getNewValue().equals("ShortLine")) colSepLine = 1; if (pce.getNewValue().equals("Dot")) colSepLine = 2; if (pce.getNewValue().equals("Hide")) colSepLine = 3; } if (pn.equals("showAttr")) { if (pce.getNewValue().equals("Hex")) showHex = true; else showHex= false; } if (pn.equals("guiInterface")) { if (pce.getNewValue().equals("Yes")) guiInterface = true; else guiInterface = false; } if (pn.equals("guiShowUnderline")) { if (pce.getNewValue().equals("Yes")) guiShowUnderline = true; else guiShowUnderline = false; } if (pn.equals("hotspots")) { if (pce.getNewValue().equals("Yes")) hotSpots = true; else hotSpots = false; } if (pn.equals("defaultPrinter")) { if (pce.getNewValue().equals("Yes")) defaultPrinter = true; else defaultPrinter = false; } if (pn.equals("resetRequired")) { if (pce.getNewValue().equals("Yes")) resetRequired = true; else resetRequired = false; } if (pn.equals("hsMore")) { hsMore.setLength(0); hsMore.append((String)pce.getNewValue()); } if (pn.equals("hsBottom")) { hsBottom.setLength(0); hsBottom.append((String)pce.getNewValue()); } if (pn.equals("font")) { font = new Font((String)pce.getNewValue(),Font.PLAIN,14); updateFont = true; } if (pn.equals("useAntialias")) { if (pce.getNewValue().equals("Yes")) bi.setUseAntialias(true); else bi.setUseAntialias(false); updateFont = true; } if (pn.equals("fontScaleHeight")) {// try { sfh = Float.parseFloat((String)pce.getNewValue()); updateFont = true;// } } if (pn.equals("fontScaleWidth")) {// try { sfw = Float.parseFloat((String)pce.getNewValue()); updateFont = true;// } } if (pn.equals("fontPointSize")) {// try { ps132 = Float.parseFloat((String)pce.getNewValue()); updateFont = true;// } } if (pn.equals("cursorBottOffset")) { cursorBottOffset = getIntProperty("cursorBottOffset"); } if (updateFont) { Rectangle r = gui.getDrawingBounds(); resizeScreenArea(r.width,r.height); updateFont = false; } if (resetAttr) { for (int y = 0;y < lenScreen; y++) { screen[y].setAttribute(screen[y].getCharAttr()); } bi.drawOIA(fmWidth,fmHeight,numRows,numCols,font,colorBg,colorBlue); } gui.validate(); gui.repaint(); } |
|
this.button = button; | public SwingButtonPeer(Button button) { SwingToolkit.add(button, this); SwingToolkit.copyAwtProperties(button, this); setText(button.getLabel()); addActionListener(new ActionListenerDelegate(button)); addMouseListener(new MouseListenerDelegate(button)); addMouseMotionListener(new MouseMotionListenerDelegate(button)); } |
|
setWasIcon(frame, true); | setWasIcon(frame, Boolean.TRUE); | public void iconifyFrame(JInternalFrame frame) { JDesktopPane p = frame.getDesktopPane(); JDesktopIcon icon = frame.getDesktopIcon(); if (p != null && p.getSelectedFrame() == frame) p.setSelectedFrame(null); else { try { frame.setSelected(false); } catch (PropertyVetoException e) { } } Container c = frame.getParent(); if (! wasIcon(frame)) { Rectangle r = getBoundsForIconOf(frame); icon.setBounds(r); setWasIcon(frame, true); } if (c != null) { if (icon != null) { c.add(icon); icon.setVisible(true); } c.remove(frame); } } // iconifyFrame() |
protected void setWasIcon(JInternalFrame frame, boolean value) | protected void setWasIcon(JInternalFrame frame, Boolean value) | protected void setWasIcon(JInternalFrame frame, boolean value) { frame.setWasIcon(value, WAS_ICON_ONCE_PROPERTY); } // setWasIcon() |
frame.setWasIcon(value, WAS_ICON_ONCE_PROPERTY); } | frame.setWasIcon(value.booleanValue(), WAS_ICON_ONCE_PROPERTY); } | protected void setWasIcon(JInternalFrame frame, boolean value) { frame.setWasIcon(value, WAS_ICON_ONCE_PROPERTY); } // setWasIcon() |
this(null, null, e); | this(null, e); | public PluginDescriptorModel(XMLElement e) throws PluginException { this(null, null, e); } |
return new PluginClassLoader(PluginDescriptorModel.this, jarFile, preLoaders); | return new PluginClassLoader(registry, PluginDescriptorModel.this, jarFile, preLoaders); | public ClassLoader getPluginClassLoader() { if (classLoader == null) { if (system) { classLoader = ClassLoader.getSystemClassLoader(); } else { if (jarFile == null) { throw new RuntimeException("Cannot create classloader without a jarfile"); } final int reqMax = requires.length; final PluginClassLoader[] preLoaders = new PluginClassLoader[reqMax]; for (int i = 0; i < reqMax; i++) { final String reqId = requires[i].getPluginId(); final PluginDescriptor reqDescr = registry.getPluginDescriptor(reqId); final ClassLoader cl = reqDescr.getPluginClassLoader(); if (cl instanceof PluginClassLoader) { preLoaders[i] = (PluginClassLoader) cl; } } final PrivilegedAction a = new PrivilegedAction() { public Object run() { return new PluginClassLoader(PluginDescriptorModel.this, jarFile, preLoaders); } }; classLoader = (PluginClassLoader)AccessController.doPrivileged(a); //new PluginClassLoader(jarFile, preLoaders); } } return classLoader; } |
return new PluginClassLoader(PluginDescriptorModel.this, jarFile, preLoaders); | return new PluginClassLoader(registry, PluginDescriptorModel.this, jarFile, preLoaders); | public Object run() { return new PluginClassLoader(PluginDescriptorModel.this, jarFile, preLoaders); } |
public final void resolve() throws PluginException { | public final void resolve(PluginRegistryModel registry) throws PluginException { if ((this.registry != null) && (this.registry != registry)) { throw new SecurityException("Cannot overwrite the registry"); } | public final void resolve() throws PluginException { if (!resolved) { for (int i = 0; i < extensions.length; i++) { extensions[i].resolve(); } for (int i = 0; i < extensionPoints.length; i++) { extensionPoints[i].resolve(); } for (int i = 0; i < requires.length; i++) { requires[i].resolve(); } if (runtime != null) { runtime.resolve(); } resolved = true; } } |
extensions[i].resolve(); } for (int i = 0; i < extensionPoints.length; i++) { extensionPoints[i].resolve(); | extensions[i].resolve(registry); | public final void resolve() throws PluginException { if (!resolved) { for (int i = 0; i < extensions.length; i++) { extensions[i].resolve(); } for (int i = 0; i < extensionPoints.length; i++) { extensionPoints[i].resolve(); } for (int i = 0; i < requires.length; i++) { requires[i].resolve(); } if (runtime != null) { runtime.resolve(); } resolved = true; } } |
requires[i].resolve(); | requires[i].resolve(registry); | public final void resolve() throws PluginException { if (!resolved) { for (int i = 0; i < extensions.length; i++) { extensions[i].resolve(); } for (int i = 0; i < extensionPoints.length; i++) { extensionPoints[i].resolve(); } for (int i = 0; i < requires.length; i++) { requires[i].resolve(); } if (runtime != null) { runtime.resolve(); } resolved = true; } } |
runtime.resolve(); | runtime.resolve(registry); | public final void resolve() throws PluginException { if (!resolved) { for (int i = 0; i < extensions.length; i++) { extensions[i].resolve(); } for (int i = 0; i < extensionPoints.length; i++) { extensionPoints[i].resolve(); } for (int i = 0; i < requires.length; i++) { requires[i].resolve(); } if (runtime != null) { runtime.resolve(); } resolved = true; } } |
final void startPlugin() throws PluginException { | final void startPlugin(final PluginRegistryModel registry) throws PluginException { | final void startPlugin() throws PluginException { if (started) { return; } synchronized (this) { if (started || starting) { return; } starting = true; //BootLog.info("Resolve on plugin " + getId()); try { AccessController.doPrivileged(new PrivilegedExceptionAction() { public Object run() throws PluginException { resolve(); final int reqMax = requires.length; for (int i = 0; i < reqMax; i++) { final String reqId = requires[i].getPluginId(); //BootLog.info("Start dependency " + reqId); final PluginDescriptorModel reqDescr = (PluginDescriptorModel)registry.getPluginDescriptor(reqId); reqDescr.startPlugin(); } //BootLog.info("Start myself " + getId()); getPlugin().start(); return null; } }); } catch (PrivilegedActionException ex) { BootLog.error("Error starting plugin", ex); try { Thread.sleep(10000); } catch (InterruptedException ex1) { // Ignore } } finally { started = true; } } } |
resolve(); | resolve(registry); | final void startPlugin() throws PluginException { if (started) { return; } synchronized (this) { if (started || starting) { return; } starting = true; //BootLog.info("Resolve on plugin " + getId()); try { AccessController.doPrivileged(new PrivilegedExceptionAction() { public Object run() throws PluginException { resolve(); final int reqMax = requires.length; for (int i = 0; i < reqMax; i++) { final String reqId = requires[i].getPluginId(); //BootLog.info("Start dependency " + reqId); final PluginDescriptorModel reqDescr = (PluginDescriptorModel)registry.getPluginDescriptor(reqId); reqDescr.startPlugin(); } //BootLog.info("Start myself " + getId()); getPlugin().start(); return null; } }); } catch (PrivilegedActionException ex) { BootLog.error("Error starting plugin", ex); try { Thread.sleep(10000); } catch (InterruptedException ex1) { // Ignore } } finally { started = true; } } } |
reqDescr.startPlugin(); | reqDescr.startPlugin(registry); | final void startPlugin() throws PluginException { if (started) { return; } synchronized (this) { if (started || starting) { return; } starting = true; //BootLog.info("Resolve on plugin " + getId()); try { AccessController.doPrivileged(new PrivilegedExceptionAction() { public Object run() throws PluginException { resolve(); final int reqMax = requires.length; for (int i = 0; i < reqMax; i++) { final String reqId = requires[i].getPluginId(); //BootLog.info("Start dependency " + reqId); final PluginDescriptorModel reqDescr = (PluginDescriptorModel)registry.getPluginDescriptor(reqId); reqDescr.startPlugin(); } //BootLog.info("Start myself " + getId()); getPlugin().start(); return null; } }); } catch (PrivilegedActionException ex) { BootLog.error("Error starting plugin", ex); try { Thread.sleep(10000); } catch (InterruptedException ex1) { // Ignore } } finally { started = true; } } } |
resolve(); | resolve(registry); | public Object run() throws PluginException { resolve(); final int reqMax = requires.length; for (int i = 0; i < reqMax; i++) { final String reqId = requires[i].getPluginId(); //BootLog.info("Start dependency " + reqId); final PluginDescriptorModel reqDescr = (PluginDescriptorModel)registry.getPluginDescriptor(reqId); reqDescr.startPlugin(); } //BootLog.info("Start myself " + getId()); getPlugin().start(); return null; } |
reqDescr.startPlugin(); | reqDescr.startPlugin(registry); | public Object run() throws PluginException { resolve(); final int reqMax = requires.length; for (int i = 0; i < reqMax; i++) { final String reqId = requires[i].getPluginId(); //BootLog.info("Start dependency " + reqId); final PluginDescriptorModel reqDescr = (PluginDescriptorModel)registry.getPluginDescriptor(reqId); reqDescr.startPlugin(); } //BootLog.info("Start myself " + getId()); getPlugin().start(); return null; } |
protected void unresolve() throws PluginException { if (resolved) { if (runtime != null) { runtime.unresolve(); } for (int i = 0; i < requires.length; i++) { requires[i].unresolve(); } for (int i = 0; i < extensionPoints.length; i++) { extensionPoints[i].unresolve(); } for (int i = 0; i < extensions.length; i++) { extensions[i].unresolve(); } resolved = false; } | protected void unresolve(PluginRegistryModel registry) throws PluginException { if (runtime != null) { runtime.unresolve(registry); } for (int i = 0; i < requires.length; i++) { requires[i].unresolve(registry); } for (int i = 0; i < extensionPoints.length; i++) { extensionPoints[i].unresolve(registry); } for (int i = 0; i < extensions.length; i++) { extensions[i].unresolve(registry); } resolved = false; | protected void unresolve() throws PluginException { if (resolved) { if (runtime != null) { runtime.unresolve(); } for (int i = 0; i < requires.length; i++) { requires[i].unresolve(); } for (int i = 0; i < extensionPoints.length; i++) { extensionPoints[i].unresolve(); } for (int i = 0; i < extensions.length; i++) { extensions[i].unresolve(); } resolved = false; } } |
public void startSystemPlugins() throws PluginException { | public void startSystemPlugins(List descriptors) throws PluginException { | public void startSystemPlugins() throws PluginException { SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(START_SYSTEM_PLUGINS_PERM); } // Resolve all plugins ((PluginRegistryModel) registry).resolveDescriptors(); // Set the context classloader Thread.currentThread().setContextClassLoader( registry.getPluginsClassLoader()); // Start the plugins final String cmdLine = (String)AccessController.doPrivileged(new GetPropertyAction("jnode.cmdline", "")); final boolean debug = (cmdLine.indexOf("debug") > 0); final List descrList = createPluginDescriptorList(); // 2 loops, first start all system plugins, // then start all auto-start plugins for (int type = 0; type < 2; type++) { for (Iterator i = descrList.iterator(); i.hasNext();) { final PluginDescriptor descr = (PluginDescriptor) i.next(); try { final boolean start; if (type == 0) { start = descr.isSystemPlugin(); } else { start = (!descr.isSystemPlugin()) && descr.isAutoStart(); } if (start) { if (debug) { Thread.sleep(250); } startSinglePlugin(descr.getPlugin()); } } catch (Throwable ex) { BootLog.error("Cannot start " + descr.getId(), ex); if (debug) { try { Thread.sleep(5000); } catch (InterruptedException ex1) { // Ignore } } } } } // Wait a while until all plugins have finished their startup process if (!isStartPluginsFinished()) { BootLog.info("Waiting for plugins to finished their startprocess"); final long start = System.currentTimeMillis(); long now = start; int loop = 0; while (!isStartPluginsFinished() && (now - start < START_TIMEOUT)) { try { if (++loop == 10) { System.out.print('.'); loop = 0; } Thread.sleep(100); } catch (InterruptedException ex) { // Ignore } now = System.currentTimeMillis(); } System.out.println(); if (now >= START_TIMEOUT) { // List all non-finished plugins listUnfinishedPlugins(); } } } |
((PluginRegistryModel) registry).resolveDescriptors(descriptors); | public void startSystemPlugins() throws PluginException { SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(START_SYSTEM_PLUGINS_PERM); } // Resolve all plugins ((PluginRegistryModel) registry).resolveDescriptors(); // Set the context classloader Thread.currentThread().setContextClassLoader( registry.getPluginsClassLoader()); // Start the plugins final String cmdLine = (String)AccessController.doPrivileged(new GetPropertyAction("jnode.cmdline", "")); final boolean debug = (cmdLine.indexOf("debug") > 0); final List descrList = createPluginDescriptorList(); // 2 loops, first start all system plugins, // then start all auto-start plugins for (int type = 0; type < 2; type++) { for (Iterator i = descrList.iterator(); i.hasNext();) { final PluginDescriptor descr = (PluginDescriptor) i.next(); try { final boolean start; if (type == 0) { start = descr.isSystemPlugin(); } else { start = (!descr.isSystemPlugin()) && descr.isAutoStart(); } if (start) { if (debug) { Thread.sleep(250); } startSinglePlugin(descr.getPlugin()); } } catch (Throwable ex) { BootLog.error("Cannot start " + descr.getId(), ex); if (debug) { try { Thread.sleep(5000); } catch (InterruptedException ex1) { // Ignore } } } } } // Wait a while until all plugins have finished their startup process if (!isStartPluginsFinished()) { BootLog.info("Waiting for plugins to finished their startprocess"); final long start = System.currentTimeMillis(); long now = start; int loop = 0; while (!isStartPluginsFinished() && (now - start < START_TIMEOUT)) { try { if (++loop == 10) { System.out.print('.'); loop = 0; } Thread.sleep(100); } catch (InterruptedException ex) { // Ignore } now = System.currentTimeMillis(); } System.out.println(); if (now >= START_TIMEOUT) { // List all non-finished plugins listUnfinishedPlugins(); } } } |
|
case LGDT_ISN: emmitLGDT(); break; case LIDT_ISN: emmitLIDT(); break; | public boolean emmit(String mnemonic, List operands, int operandSize) { this.operands = operands; this.operandSize = operandSize; Integer key = (Integer) INSTRUCTION_MAP.get(mnemonic); if (key == null) return false; switch (key.intValue()) { case ADC_ISN: emmitADC(); break; case ADD_ISN: emmitADD(); break; case AND_ISN: emmitAND(); break; case CALL_ISN: emmitCALL(); break; case CLD_ISN: emmitCLD(); break; case CLI_ISN: emmitCLI(); break; case CLTS_ISN: emmitCLTS(); break; case CMP_ISN: emmitCMP(); break; case CPUID_ISN: emmitCPUID(); break; case DEC_ISN: emmitDEC(); break; case DIV_ISN: emmitDIV(); break; case FLDCW_ISN: emmitFLDCW(); break; case FNINIT_ISN: emmitFNINIT(); break; case FNSAVE_ISN: emmitFNSAVE(); break; case FRSTOR_ISN: emmitFRSTOR(); break; case FSTCW_ISN: emmitFSTCW(); break; case FXRSTOR_ISN: emmitFXRSTOR(); break; case FXSAVE_ISN: emmitFXSAVE(); break; case HLT_ISN: emmitHLT(); break; case IN_ISN: emmitIN(); break; case INC_ISN: emmitINC(); break; case INT_ISN: emmitINT(); break; case IRET_ISN: emmitIRET(); break; case JA_ISN: emmitJCC(X86Assembler.JA); case JAE_ISN: emmitJCC(X86Assembler.JAE); case JB_ISN: emmitJCC(X86Assembler.JB); break; case JE_ISN: emmitJCC(X86Assembler.JE); break;//TODO the X86BinaryAssembler support for this is buggy, cannot handle forward jumps. case JECXZ_ISN: emmitJECXZ(); break; case JL_ISN: emmitJCC(X86Assembler.JL); break; case JLE_ISN: emmitJCC(X86Assembler.JLE); break; case JMP_ISN: emmitJMP(); break; case JNE_ISN: emmitJCC(X86Assembler.JNE); break; case JNZ_ISN: emmitJCC(X86Assembler.JNZ); break; case JZ_ISN: emmitJCC(X86Assembler.JZ); break; case LDMXCSR_ISN: emmitLDMXCSR(); break; case LEA_ISN: emmitLEA(); break; case LMSW_ISN: emmitLMSW(); break; case LODSW_ISN: emmitLODSW(); break; case LOOP_ISN: emmitLOOP(); break; case LTR_ISN: emmitLTR(); break; case MOV_ISN: emmitMOV(); break; case MOVSB_ISN: emmitMOVSB(); break; case MOVSW_ISN: emmitMOVSW(); break; case MOVSD_ISN: emmitMOVSD(); break; case MOVZX_ISN: emmitMOVZX(); break; case NEG_ISN: emmitNEG(); break; case NOP_ISN: emmitNOP(); break; case OR_ISN: emmitOR(); break; case OUT_ISN: emmitOUT(); break; case POP_ISN: emmitPOP(); break; case POPA_ISN: emmitPOPA(); break; case POPF_ISN: emmitPOPF(); break; case PUSH_ISN: emmitPUSH(); break; case PUSHA_ISN: emmitPUSHA(); break; case PUSHF_ISN: emmitPUSHF(); break; case RET_ISN: emmitRET(); break; case SHL_ISN: emmitSHL(); break; case SHR_ISN: emmitSHR(); break; case STD_ISN: emmitSTD(); break; case STI_ISN: emmitSTI(); break; case STMXCSR_ISN: emmitSTMXCSR(); break; case STOSB_ISN: emmitSTOSB(); break; case STOSD_ISN: emmitSTOSD(); break; case STOSW_ISN: emmitSTOSW(); break; case SUB_ISN: emmitSUB(); break; case TEST_ISN: emmitTEST(); break; case XCHG_ISN: emmitXCHG(); break; case XOR_ISN: emmitXOR(); break; default: throw new Error("Invalid instruction binding " + key.intValue() + " for " + mnemonic); } return true; } |
|
case AC_ADDR: stream.writeADD(operandSize, getAddress(0).disp, getInt(1)); break; | private final void emmitADD() { int addr = getAddressingMode(2); switch (addr) { case RR_ADDR: stream.writeADD(getReg(0), getReg(1)); break; case RC_ADDR: stream.writeADD(getReg(0), getInt(1)); break; case RE_ADDR: Address ind = getAddress(1); stream.writeADD(getReg(0), getRegister(ind.getImg()), ind.disp); break; case ER_ADDR: ind = getAddress(0); stream.writeADD(getRegister(ind.getImg()), ind.disp, getReg(1)); break; case EC_ADDR: ind = getAddress(0); stream.writeADD(operandSize, getRegister(ind.getImg()), ind.disp, getInt(1)); break; default: reportAddressingError(ADD_ISN, addr); } } |
|
case AC_ADDR: stream.writeAND(operandSize, getAddress(0).disp, getInt(1)); break; | private final void emmitAND() { int addr = getAddressingMode(2); switch (addr) { case RR_ADDR: stream.writeAND(getReg(0), getReg(1)); break; case RC_ADDR: stream.writeAND(getReg(0), getInt(1)); break; case RE_ADDR: Address ind = getAddress(1); stream.writeAND(getReg(0), getRegister(ind.getImg()), ind.disp); break; case ER_ADDR: ind = getAddress(0); stream.writeAND(getRegister(ind.getImg()), ind.disp, getReg(1)); break; case EC_ADDR: ind = getAddress(0); stream.writeAND(operandSize, getRegister(ind.getImg()), ind.disp, getInt(1)); break; default: reportAddressingError(AND_ISN, addr); } } |
|
} else if (o1 instanceof Address) { Address ind = (Address) o1; if (ind.reg != null && ind.sreg != null) { throw new IllegalArgumentException("Scaled is not supported for call "); } else if (ind.reg != null && ind.sreg == null) { stream.writeCALL(getRegister(ind.getImg()), ind.disp); } else if (ind.reg == null && ind.sreg != null) { throw new IllegalArgumentException("Simple scaled is not supported for call "); } else if (ind.reg == null && ind.sreg == null) { throw new IllegalArgumentException("Absolute is not supported for call "); } else { throw new IllegalArgumentException("Unknown indirect: " + ind); } | private final void emmitCALL() { Object o1 = operands.get(0); if (o1 instanceof Register) { stream.writeCALL(getRegister(((Register) o1).name)); } else if (o1 instanceof Identifier) { String id = ((Identifier) o1).name; Label lab = (Label) labels.get(id); lab = (lab == null) ? new Label(id) : lab; stream.writeCALL(lab); } else { throw new IllegalArgumentException("Unknown operand: " + o1); } } |
|
case A_ADDR: stream.writeINC(operandSize, getAddress(0).disp); break; case S_ADDR: ind = getAddress(0); stream.writeINC(operandSize, getRegister(ind.getImg()), getRegister(ind.sreg), ind.scale, ind.disp); break; | private final void emmitINC() { int addr = getAddressingMode(1); switch (addr) { case R_ADDR: stream.writeINC(getReg(0)); break; case E_ADDR: Address ind = getAddress(0); stream.writeINC(operandSize, getRegister(ind.getImg()), ind.disp); break; default: reportAddressingError(INC_ISN, addr); } } |
|
case RS_ADDR: ind = getAddress(1); stream.writeLEA(getReg(0), getRegister(ind.getImg()), getRegister(ind.sreg), ind.scale, ind.disp); break; case RZ_ADDR: ind = getAddress(1); stream.writeLEA(getReg(0), getRegister(ind.sreg), ind.scale, ind.disp); break; | private final void emmitLEA() { int addr = getAddressingMode(2); switch (addr) { case RE_ADDR: Address ind = getAddress(1); stream.writeLEA(getReg(0), getRegister(ind.getImg()), ind.disp); break; default: reportAddressingError(LEA_ISN, addr); } } |
|
stream.writeMOV(operandSize, (GPR) r1, (GPR) r2); | int s1 = r1.getSize(); int s2 = r2.getSize(); if(s1 != s2){ throw new IllegalArgumentException("Incompatible register pair: " + r1 + "," + r2); } stream.writeMOV(s1, (GPR) r1, (GPR) r2); | private final void emmitMOV() { int addr = getAddressingMode(2); switch (addr) { case RR_ADDR: X86Register r1 = X86Register.getRegister(((Register) args[0]).name); X86Register r2 = X86Register.getRegister(((Register) args[1]).name); if (r1 instanceof GPR && r2 instanceof GPR) { stream.writeMOV(operandSize, (GPR) r1, (GPR) r2); } else if (r1 instanceof CRX && r2 instanceof GPR) { stream.writeMOV((CRX) r1, (GPR) r2); } else if (r1 instanceof GPR && r2 instanceof CRX) { stream.writeMOV((GPR) r1, (CRX) r2); } else if (r1 instanceof SR && r2 instanceof GPR) { stream.writeMOV((SR) r1, (GPR) r2); } else if (r1 instanceof GPR && r2 instanceof SR) { stream.writeMOV((GPR) r1, (SR) r2); } else { throw new IllegalArgumentException("Invalid register usage: mov " + r1 + "," + r2); } break; case RC_ADDR: stream.writeMOV_Const(getReg(0), getInt(1)); break; case RE_ADDR: Address ind = getAddress(1); stream.writeMOV(operandSize, getReg(0), getRegister(ind.getImg()), ind.disp); break; case ER_ADDR: ind = getAddress(0); stream.writeMOV(operandSize, getRegister(ind.getImg()), ind.disp, getReg(1)); break; case EC_ADDR: ind = getAddress(0); stream.writeMOV_Const(operandSize, getRegister(ind.getImg()), ind.disp, getInt(1)); break; default: reportAddressingError(MOV_ISN, addr); } } |
stream.writeMOV(operandSize, getReg(0), getRegister(ind.getImg()), ind.disp); | stream.writeMOV(r.getSize(), r, getRegister(ind.getImg()), ind.disp); break; case RA_ADDR: stream.writeMOV(getReg(0), getAddress(1).disp); | private final void emmitMOV() { int addr = getAddressingMode(2); switch (addr) { case RR_ADDR: X86Register r1 = X86Register.getRegister(((Register) args[0]).name); X86Register r2 = X86Register.getRegister(((Register) args[1]).name); if (r1 instanceof GPR && r2 instanceof GPR) { stream.writeMOV(operandSize, (GPR) r1, (GPR) r2); } else if (r1 instanceof CRX && r2 instanceof GPR) { stream.writeMOV((CRX) r1, (GPR) r2); } else if (r1 instanceof GPR && r2 instanceof CRX) { stream.writeMOV((GPR) r1, (CRX) r2); } else if (r1 instanceof SR && r2 instanceof GPR) { stream.writeMOV((SR) r1, (GPR) r2); } else if (r1 instanceof GPR && r2 instanceof SR) { stream.writeMOV((GPR) r1, (SR) r2); } else { throw new IllegalArgumentException("Invalid register usage: mov " + r1 + "," + r2); } break; case RC_ADDR: stream.writeMOV_Const(getReg(0), getInt(1)); break; case RE_ADDR: Address ind = getAddress(1); stream.writeMOV(operandSize, getReg(0), getRegister(ind.getImg()), ind.disp); break; case ER_ADDR: ind = getAddress(0); stream.writeMOV(operandSize, getRegister(ind.getImg()), ind.disp, getReg(1)); break; case EC_ADDR: ind = getAddress(0); stream.writeMOV_Const(operandSize, getRegister(ind.getImg()), ind.disp, getInt(1)); break; default: reportAddressingError(MOV_ISN, addr); } } |
case AR_ADDR: stream.writeMOV(getAddress(0).disp, getReg(1)); break; case AC_ADDR: stream.writeMOV_Const(operandSize, getAddress(0).disp, getInt(1)); break; case SR_ADDR: ind = getAddress(0); stream.writeMOV(operandSize, getRegister(ind.getImg()), getRegister(ind.sreg), ind.scale, ind.disp, getReg(1)); break; | private final void emmitMOV() { int addr = getAddressingMode(2); switch (addr) { case RR_ADDR: X86Register r1 = X86Register.getRegister(((Register) args[0]).name); X86Register r2 = X86Register.getRegister(((Register) args[1]).name); if (r1 instanceof GPR && r2 instanceof GPR) { stream.writeMOV(operandSize, (GPR) r1, (GPR) r2); } else if (r1 instanceof CRX && r2 instanceof GPR) { stream.writeMOV((CRX) r1, (GPR) r2); } else if (r1 instanceof GPR && r2 instanceof CRX) { stream.writeMOV((GPR) r1, (CRX) r2); } else if (r1 instanceof SR && r2 instanceof GPR) { stream.writeMOV((SR) r1, (GPR) r2); } else if (r1 instanceof GPR && r2 instanceof SR) { stream.writeMOV((GPR) r1, (SR) r2); } else { throw new IllegalArgumentException("Invalid register usage: mov " + r1 + "," + r2); } break; case RC_ADDR: stream.writeMOV_Const(getReg(0), getInt(1)); break; case RE_ADDR: Address ind = getAddress(1); stream.writeMOV(operandSize, getReg(0), getRegister(ind.getImg()), ind.disp); break; case ER_ADDR: ind = getAddress(0); stream.writeMOV(operandSize, getRegister(ind.getImg()), ind.disp, getReg(1)); break; case EC_ADDR: ind = getAddress(0); stream.writeMOV_Const(operandSize, getRegister(ind.getImg()), ind.disp, getInt(1)); break; default: reportAddressingError(MOV_ISN, addr); } } |
|
case AC_ADDR: stream.writeOR(operandSize, getAddress(0).disp, getInt(1)); break; | private final void emmitOR() { int addr = getAddressingMode(2); switch (addr) { case RR_ADDR: stream.writeOR(getReg(0), getReg(1)); break; case RC_ADDR: stream.writeOR(getReg(0), getInt(1)); break; case RE_ADDR: Address ind = getAddress(1); stream.writeOR(getReg(0), getRegister(ind.getImg()), ind.disp); break; case ER_ADDR: ind = getAddress(0); stream.writeOR(getRegister(ind.getImg()), ind.disp, getReg(1)); break; case EC_ADDR: ind = getAddress(0); stream.writeOR(operandSize, getRegister(ind.getImg()), ind.disp, getInt(1)); break; default: reportAddressingError(OR_ISN, addr); } } |
|
case AR_ADDR: stream.writeSUB(getAddress(0).disp, getReg(1)); break; | private final void emmitSUB() { int addr = getAddressingMode(2); switch (addr) { case RR_ADDR: stream.writeSUB(getReg(0), getReg(1)); break; case RC_ADDR: stream.writeSUB(getReg(0), getInt(1)); break; case RE_ADDR: Address ind = getAddress(1); stream.writeSUB(getReg(0), getRegister(ind.getImg()), ind.disp); break; case ER_ADDR: ind = getAddress(0); stream.writeSUB(getRegister(ind.getImg()), ind.disp, getReg(1)); break; case EC_ADDR: ind = getAddress(0); stream.writeSUB(operandSize, getRegister(ind.getImg()), ind.disp, getInt(1)); break; default: reportAddressingError(SUB_ISN, addr); } } |
|
case AC_ADDR: stream.writeTEST(operandSize, getAddress(0).disp, getInt(1)); break; | private final void emmitTEST() { int addr = getAddressingMode(2); switch (addr) { case RR_ADDR: stream.writeTEST(getReg(0), getReg(1)); break; case RC_ADDR: stream.writeTEST(getReg(0), getInt(1)); break; case EC_ADDR: Address ind = getAddress(0); stream.writeTEST(operandSize, getRegister(ind.getImg()), ind.disp, getInt(1)); break; default: reportAddressingError(TEST_ISN, addr); } } |
|
Address ind = getAddress(0); | ind = getAddress(0); | private final void emmitXCHG() { int addr = getAddressingMode(2); switch (addr) { case RR_ADDR: stream.writeXCHG(getReg(0), getReg(1)); break; case ER_ADDR: Address ind = getAddress(0); stream.writeXCHG(getRegister(ind.getImg()), ind.disp, getReg(1)); break; default: reportAddressingError(XCHG_ISN, addr); } } |
break; case AR_ADDR: stream.writeXCHG(getAddress(0).disp, getReg(1)); | private final void emmitXCHG() { int addr = getAddressingMode(2); switch (addr) { case RR_ADDR: stream.writeXCHG(getReg(0), getReg(1)); break; case ER_ADDR: Address ind = getAddress(0); stream.writeXCHG(getRegister(ind.getImg()), ind.disp, getReg(1)); break; default: reportAddressingError(XCHG_ISN, addr); } } |
|
if (ind.reg != null && ind.sreg != null) { | if (ind.segment){ ret |= SEG_ARG << DISP * i; } else if (ind.reg != null && ind.sreg != null) { | private int getAddressingMode(int maxArgs) { int ret = N_ADDR; if (maxArgs > 3) { throw new Error("Invalid number of arguments: " + maxArgs); } for (int i = 0; i < maxArgs; i++) { try { if (operands == null) break; Object o = operands.get(i); if (o == null) break; if (o instanceof Integer) { ret |= CON_ARG << DISP * i; } else if (o instanceof Register) { ret |= REG_ARG << DISP * i; } else if (o instanceof Address) { Address ind = (Address) o; if (ind.reg != null && ind.sreg != null) { ret |= SCL_ARG << DISP * i; } else if (ind.reg != null && ind.sreg == null) { ret |= REL_ARG << DISP * i; } else if (ind.reg == null && ind.sreg != null) { ret |= ZSC_ARG << DISP * i; } else if (ind.reg == null && ind.sreg == null) { ret |= ABS_ARG << DISP * i; } else { throw new IllegalArgumentException("Unknown indirect: " + ind); } } else { throw new IllegalArgumentException("Unknown operand: " + o + " " + o.getClass().getName()); } args[i] = o; } catch (IndexOutOfBoundsException x) { break; } } return ret; } |
public Error(String s) | public Error() | public Error(String s) { super(s); } |
super(s); | public Error(String s) { super(s); } |
|
public static ActionListener add(ActionListener a, ActionListener b) | public static ComponentListener add(ComponentListener a, ComponentListener b) | public static ActionListener add(ActionListener a, ActionListener b) { return (ActionListener) addInternal(a, b); } |
return (ActionListener) addInternal(a, b); | return (ComponentListener) addInternal(a, b); | public static ActionListener add(ActionListener a, ActionListener b) { return (ActionListener) addInternal(a, b); } |
public static ActionListener remove(ActionListener l, ActionListener oldl) | protected EventListener remove(EventListener oldl) | public static ActionListener remove(ActionListener l, ActionListener oldl) { return (ActionListener) removeInternal(l, oldl); } |
return (ActionListener) removeInternal(l, oldl); | if (a == oldl) return b; if (b == oldl) return a; if (a instanceof AWTEventMulticaster) { EventListener newa = ((AWTEventMulticaster) a).remove(oldl); if (newa != a) return new AWTEventMulticaster(newa, b); } if (b instanceof AWTEventMulticaster) { EventListener newb = ((AWTEventMulticaster) b).remove(oldl); if (newb != b) return new AWTEventMulticaster(a, newb); } return this; | public static ActionListener remove(ActionListener l, ActionListener oldl) { return (ActionListener) removeInternal(l, oldl); } |
public abstract byte get (); | public ByteBuffer get (byte[] dst, int offset, int length) { checkArraySize(dst.length, offset, length); checkForUnderflow(length); for (int i = offset; i < offset + length; i++) { dst [i] = get (); } return this; } | public abstract byte get (); |
public abstract int get (int index); | public IntBuffer get (int[] dst, int offset, int length) { checkArraySize(dst.length, offset, length); checkForUnderflow(length); for (int i = offset; i < offset + length; i++) { dst [i] = get (); } return this; } | public abstract int get (int index); |
public abstract char get (int index); | public CharBuffer get (char[] dst, int offset, int length) { checkArraySize(dst.length, offset, length); checkForUnderflow(length); for (int i = offset; i < offset + length; i++) { dst [i] = get (); } return this; } | public abstract char get (int index); |
public abstract short get (int index); | public ShortBuffer get (short[] dst, int offset, int length) { checkArraySize(dst.length, offset, length); checkForUnderflow(length); for (int i = offset; i < offset + length; i++) { dst [i] = get (); } return this; } | public abstract short get (int index); |
public static NumberFormat getInstance (Locale loc) | public static final NumberFormat getInstance () | public static NumberFormat getInstance (Locale loc) { // For now always return a number instance. return getNumberInstance (loc); } |
return getNumberInstance (loc); | return getInstance (Locale.getDefault()); | public static NumberFormat getInstance (Locale loc) { // For now always return a number instance. return getNumberInstance (loc); } |
public static NumberFormat getCurrencyInstance (Locale loc) | public static final NumberFormat getCurrencyInstance () | public static NumberFormat getCurrencyInstance (Locale loc) { return computeInstance (loc, "currencyFormat", "$#,##0.00;($#,##0.00)"); } |
return computeInstance (loc, "currencyFormat", "$#,##0.00;($#,##0.00)"); | return getCurrencyInstance (Locale.getDefault()); | public static NumberFormat getCurrencyInstance (Locale loc) { return computeInstance (loc, "currencyFormat", "$#,##0.00;($#,##0.00)"); } |
public static NumberFormat getPercentInstance (Locale loc) | public static final NumberFormat getPercentInstance () | public static NumberFormat getPercentInstance (Locale loc) { return computeInstance (loc, "percentFormat", "#,##0%"); } |
return computeInstance (loc, "percentFormat", "#,##0%"); | return getPercentInstance (Locale.getDefault()); | public static NumberFormat getPercentInstance (Locale loc) { return computeInstance (loc, "percentFormat", "#,##0%"); } |
public static NumberFormat getNumberInstance (Locale loc) | public static final NumberFormat getNumberInstance () | public static NumberFormat getNumberInstance (Locale loc) { return computeInstance (loc, "numberFormat", "#,##0.###"); } |
return computeInstance (loc, "numberFormat", "#,##0.###"); | return getNumberInstance (Locale.getDefault()); | public static NumberFormat getNumberInstance (Locale loc) { return computeInstance (loc, "numberFormat", "#,##0.###"); } |
public static final DateFormat getDateInstance (int style, Locale loc) | public static final DateFormat getDateInstance () | public static final DateFormat getDateInstance (int style, Locale loc) { return computeInstance (style, loc, true, false); } |
return computeInstance (style, loc, true, false); | return getDateInstance (DEFAULT, Locale.getDefault()); | public static final DateFormat getDateInstance (int style, Locale loc) { return computeInstance (style, loc, true, false); } |
tokens = new Vector(); | tokens = new ArrayList(); | public void applyPattern(String pattern) { tokens = new Vector(); compileFormat(pattern); this.pattern = pattern; } |
public FieldPosition (int field_id) | public FieldPosition (Format.Field field) | public FieldPosition (int field_id) { this.field_id = field_id; } |
this.field_id = field_id; | this(field, -1); | public FieldPosition (int field_id) { this.field_id = field_id; } |
public abstract StringBuffer format (Object obj, StringBuffer sb, FieldPosition pos) throws IllegalArgumentException; | public final String format(Object obj) throws IllegalArgumentException { StringBuffer sb = new StringBuffer (); format (obj, sb, new FieldPosition (0)); return sb.toString (); } | public abstract StringBuffer format (Object obj, StringBuffer sb, FieldPosition pos) throws IllegalArgumentException; |
public synchronized StringBuffer append(String str) | public StringBuffer append(Object obj) | public synchronized StringBuffer append(String str) { if (str == null) str = "null"; int len = str.count; ensureCapacity_unsynchronized(count + len); str.getChars(0, len, value, count); count += len; return this; } |
if (str == null) str = "null"; int len = str.count; ensureCapacity_unsynchronized(count + len); str.getChars(0, len, value, count); count += len; return this; | return append(obj == null ? "null" : obj.toString()); | public synchronized StringBuffer append(String str) { if (str == null) str = "null"; int len = str.count; ensureCapacity_unsynchronized(count + len); str.getChars(0, len, value, count); count += len; return this; } |
public void append (String text) | public void append (AttributedCharacterIterator iterator) | public void append (String text) { append (text, null); } |
append (text, null); | char c = iterator.first(); Vector more_ranges = new Vector(); Vector more_attributes = new Vector(); do { formattedString = formattedString + String.valueOf (c); more_attributes.add (iterator.getAttributes()); more_ranges.add (new Integer (formattedString.length())); c = iterator.next(); } while (c != DONE); HashMap[] new_attributes = new HashMap[attributes.length + more_attributes.size()]; int[] new_ranges = new int[ranges.length + more_ranges.size()]; System.arraycopy (attributes, 0, new_attributes, 0, attributes.length); System.arraycopy (more_attributes.toArray(), 0, new_attributes, attributes.length, more_attributes.size()); System.arraycopy (ranges, 0, new_ranges, 0, ranges.length); Object[] new_ranges_array = more_ranges.toArray(); for (int i = 0; i < more_ranges.size();i++) new_ranges[i+ranges.length] = ((Integer) new_ranges_array[i]).intValue(); attributes = new_attributes; ranges = new_ranges; | public void append (String text) { append (text, null); } |
public abstract Object parseObject (String str, ParsePosition pos); | public Object parseObject (String str) throws ParseException { ParsePosition pos = new ParsePosition(0); Object result = parseObject (str, pos); if (result == null) { int index = pos.getErrorIndex(); if (index < 0) index = pos.getIndex(); throw new ParseException("parseObject failed", index); } return result; } | public abstract Object parseObject (String str, ParsePosition pos); |
public abstract int getBeginIndex (); | int getBeginIndex(); | public abstract int getBeginIndex (); |
public abstract int getEndIndex (); | int getEndIndex(); | public abstract int getEndIndex (); |
getAllAttributeKeys(); | Set getAllAttributeKeys(); | getAllAttributeKeys(); |
public abstract char setIndex (int index) throws IllegalArgumentException; | char setIndex (int index) throws IllegalArgumentException; | public abstract char setIndex (int index) throws IllegalArgumentException; |
public ArrayList() | public ArrayList(int capacity) | public ArrayList() { this(DEFAULT_CAPACITY); } |
this(DEFAULT_CAPACITY); | if (capacity < 0) throw new IllegalArgumentException(); data = (E[]) new Object[capacity]; | public ArrayList() { this(DEFAULT_CAPACITY); } |
getRunLimit(AttributedCharacterIterator.Attribute attrib); | int getRunLimit(); | getRunLimit(AttributedCharacterIterator.Attribute attrib); |
getRunStart(AttributedCharacterIterator.Attribute attrib); | int getRunStart(); | getRunStart(AttributedCharacterIterator.Attribute attrib); |
public abstract int getIndex (); | int getIndex(); | public abstract int getIndex (); |
getAttribute(AttributedCharacterIterator.Attribute attrib); | Object getAttribute (AttributedCharacterIterator.Attribute attrib); | getAttribute(AttributedCharacterIterator.Attribute attrib); |
public abstract char next (); | char next(); | public abstract char next (); |
public <T> T[] toArray(T[] a) | public Object[] toArray() | public <T> T[] toArray(T[] a) { if (a.length < size) a = (T[]) Array.newInstance(a.getClass().getComponentType(), size); else if (a.length > size) a[size] = null; System.arraycopy(data, 0, a, 0, size); return a; } |
if (a.length < size) a = (T[]) Array.newInstance(a.getClass().getComponentType(), size); else if (a.length > size) a[size] = null; System.arraycopy(data, 0, a, 0, size); return a; | E[] array = (E[]) new Object[size]; System.arraycopy(data, 0, array, 0, size); return array; | public <T> T[] toArray(T[] a) { if (a.length < size) a = (T[]) Array.newInstance(a.getClass().getComponentType(), size); else if (a.length > size) a[size] = null; System.arraycopy(data, 0, a, 0, size); return a; } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.