rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
|
---|---|---|
public void setFlags(long flags) { | public synchronized void setFlags(long flags) { | public void setFlags(long flags) { Ext2Utils.set32(data, 32, flags); setDirty(true); } |
public void setGeneration(long gen) { | public synchronized void setGeneration(long gen) { | public void setGeneration(long gen) { Ext2Utils.set32(data, 100, gen); setDirty(true); } |
public void setGid(int gid) { | public synchronized void setGid(int gid) { | public void setGid(int gid) { Ext2Utils.set16(data, 24, gid); setDirty(true); } |
public void setLinksCount(int lc) { | public synchronized void setLinksCount(int lc) { | public void setLinksCount(int lc) { Ext2Utils.set16(data, 26, lc); setDirty(true); } |
public void setMode(int imode) { | public synchronized void setMode(int imode) { | public void setMode(int imode) { Ext2Utils.set16(data, 0, imode); setDirty(true); } |
public void setMtime(long mtime) { | public synchronized void setMtime(long mtime) { | public void setMtime(long mtime) { Ext2Utils.set32(data, 16, mtime); setDirty(true); } |
public void setOSD1(long osd1) { | public synchronized void setOSD1(long osd1) { | public void setOSD1(long osd1) { Ext2Utils.set32(data, 36, osd1); setDirty(true); } |
public void setSize(long size) { | public synchronized void setSize(long size) { | public void setSize(long size) { Ext2Utils.set32(data, 4, size); setDirty(true); } |
public void setUid(int uid) { | public synchronized void setUid(int uid) { | public void setUid(int uid) { Ext2Utils.set16(data, 2, uid); setDirty(true); } |
int red = (value & RED_MASK) >> 16; int green = (value & GREEN_MASK) >> 8; int blue = value & BLUE_MASK; red = red < 3 ? 3 : (int) Math.min(255, red / BRIGHT_SCALE); green = green < 3 ? 3 : (int) Math.min(255, green / BRIGHT_SCALE); blue = blue < 3 ? 3 : (int) Math.min(255, blue / BRIGHT_SCALE); return new Color(red, green, blue, 255); | int[] hues = new int[3]; hues[0] = (value & RED_MASK) >> 16; hues[1] = (value & GREEN_MASK) >> 8; hues[2] = value & BLUE_MASK; if (hues[0] == 0 && hues[1] == 0 && hues[2] ==0) { hues[0] = 3; hues[1] = 3; hues[2] = 3; | public Color brighter() { // Do not inline getRGB() to this.value, because of SystemColor. int value = getRGB(); int red = (value & RED_MASK) >> 16; int green = (value & GREEN_MASK) >> 8; int blue = value & BLUE_MASK; // We have to special case 0-2 because they won't scale by division. red = red < 3 ? 3 : (int) Math.min(255, red / BRIGHT_SCALE); green = green < 3 ? 3 : (int) Math.min(255, green / BRIGHT_SCALE); blue = blue < 3 ? 3 : (int) Math.min(255, blue / BRIGHT_SCALE); return new Color(red, green, blue, 255); } |
else { for (int index = 0; index < 3; index++) { if (hues[index] > 2) hues[index] = (int) Math.min(255, hues[index]/0.7f); if (hues[index] == 1 || hues[index] == 2) hues[index] = 4; } } return new Color(hues[0], hues[1], hues[2], 255); } | public Color brighter() { // Do not inline getRGB() to this.value, because of SystemColor. int value = getRGB(); int red = (value & RED_MASK) >> 16; int green = (value & GREEN_MASK) >> 8; int blue = value & BLUE_MASK; // We have to special case 0-2 because they won't scale by division. red = red < 3 ? 3 : (int) Math.min(255, red / BRIGHT_SCALE); green = green < 3 ? 3 : (int) Math.min(255, green / BRIGHT_SCALE); blue = blue < 3 ? 3 : (int) Math.min(255, blue / BRIGHT_SCALE); return new Color(red, green, blue, 255); } |
|
public VolumeDescriptor( ISO9660Volume volume, byte[] buffer) throws IOException { this.volume = volume; init(buffer); } | public VolumeDescriptor(ISO9660Volume volume, byte[] buff) throws IOException { this.volume = volume; this.type = LittleEndian.getUInt8(buff, 0); this.standardIdentifier = new String(buff, 1, 5); this.systemIdentifier = new String(buff, 8, 31); this.volumeIdentifier = new String(buff, 40, 31); this.volumeSetIdentifier = new String(buff, 190, 127); this.numberOfLB = LittleEndian.getUInt32(buff, 80); this.volumeSetSize = LittleEndian.getUInt16(buff, 120); this.LBSize = LittleEndian.getUInt16(buff, 128); this.pathTableSize = (int) LittleEndian.getUInt32(buff, 132); this.locationOfTyp_L_PathTable = (int) LittleEndian .getUInt32(buff, 140); this.locationOfOptionalTyp_L_PathTable = (int) LittleEndian.getUInt32( buff, 144); this.locationOfTyp_M_PathTable = (int) BigEndian.getUInt32(buff, 148); this.locationOfOptionalTyp_M_PathTable = (int) BigEndian.getUInt32( buff, 152); this.rootDirectoryEntry = new EntryRecord(volume, buff, 156, "US-ASCII"); } | public VolumeDescriptor( ISO9660Volume volume, byte[] buffer) throws IOException { this.volume = volume; init(buffer); } |
public int getNumberOfLB() { return numberOfLB; } | public long getNumberOfLB() { return numberOfLB; } | public int getNumberOfLB() { return numberOfLB; } |
public void printOut() { System.out.println("Primary volume information: "); System.out.println(" - Standard Identifier: " + this.getStandardIdentifier()); System.out.println(" - System Identifier: " + this.getSystemIdentifier()); System.out.println(" - Volume Identifier: " + this.getVolumeIdentifier()); System.out.println(" - Volume set Identifier: " + this.getVolumeSetIdentifier()); System.out.println(" - Volume set size: " + this.getVolumeSetSize()); System.out.println(" - Number of LBs: " + this.getNumberOfLB()); System.out.println(" - Size of LBs: " + this.getLBSize()); System.out.println(" - PathTable size: " + this.getPathTableSize()); System.out.println(" - Location of L PathTable : " + this.getLocationOfTyp_L_PathTable()); System.out.println(" - Location of Optional L PathTable : " + this.getLocationOfOptionalTyp_L_PathTable()); System.out.println(" - Location of M PathTable : " + this.getLocationOfTyp_M_PathTable()); System.out.println(" - Location of Optional M PathTable : " + this.getLocationOfOptionalTyp_M_PathTable()); System.out.println(" - Root directory entry: " ); System.out.println(" - Size: " + this.getRootDirectoryEntry().getLengthOfDirectoryEntry()); System.out.println(" - Extended attribute size: " + this.getRootDirectoryEntry().getLengthOfExtendedAttribute()); System.out.println(" - Location of the extent: " + this.getRootDirectoryEntry().getLocationOfExtent()); System.out.println(" - Length of the file identifier: " + this.getRootDirectoryEntry().getLengthOfFileIdentifier()); System.out.println(" - is directory: " + this.getRootDirectoryEntry().isDirectory()); System.out.println(" - File identifier: " + this.getRootDirectoryEntry().getFileIdentifier()); System.out.println(" - Data Length: " + this.getRootDirectoryEntry().getDataLength()); System.out.println(" - File unit size: " + this.getRootDirectoryEntry().getFileUnitSize()); } | public void printOut() { System.out.println("Primary volume information: "); System.out.println(" - Standard Identifier: " + this.getStandardIdentifier()); System.out.println(" - System Identifier: " + this.getSystemIdentifier()); System.out.println(" - Volume Identifier: " + this.getVolumeIdentifier()); System.out.println(" - Volume set Identifier: " + this.getVolumeSetIdentifier()); System.out.println(" - Volume set size: " + this.getVolumeSetSize()); System.out.println(" - Number of LBs: " + this.getNumberOfLB()); System.out.println(" - Size of LBs: " + this.getLBSize()); System.out.println(" - PathTable size: " + this.getPathTableSize()); System.out.println(" - Location of L PathTable : " + this.getLocationOfTyp_L_PathTable()); System.out.println(" - Location of Optional L PathTable : " + this.getLocationOfOptionalTyp_L_PathTable()); System.out.println(" - Location of M PathTable : " + this.getLocationOfTyp_M_PathTable()); System.out.println(" - Location of Optional M PathTable : " + this.getLocationOfOptionalTyp_M_PathTable()); System.out.println(" - Root directory entry: "); System.out.println(" - Size: " + this.getRootDirectoryEntry().getLengthOfDirectoryEntry()); System.out.println(" - Extended attribute size: " + this.getRootDirectoryEntry().getLengthOfExtendedAttribute()); System.out.println(" - Location of the extent: " + this.getRootDirectoryEntry().getLocationOfExtent()); System.out.println(" - is directory: " + this.getRootDirectoryEntry().isDirectory()); System.out.println(" - File identifier: " + this.getRootDirectoryEntry().getFileIdentifier()); System.out.println(" - Data Length: " + this.getRootDirectoryEntry().getDataLength()); System.out.println(" - File unit size: " + this.getRootDirectoryEntry().getFileUnitSize()); } | public void printOut() { System.out.println("Primary volume information: "); System.out.println(" - Standard Identifier: " + this.getStandardIdentifier()); System.out.println(" - System Identifier: " + this.getSystemIdentifier()); System.out.println(" - Volume Identifier: " + this.getVolumeIdentifier()); System.out.println(" - Volume set Identifier: " + this.getVolumeSetIdentifier()); System.out.println(" - Volume set size: " + this.getVolumeSetSize()); System.out.println(" - Number of LBs: " + this.getNumberOfLB()); System.out.println(" - Size of LBs: " + this.getLBSize()); System.out.println(" - PathTable size: " + this.getPathTableSize()); System.out.println(" - Location of L PathTable : " + this.getLocationOfTyp_L_PathTable()); System.out.println(" - Location of Optional L PathTable : " + this.getLocationOfOptionalTyp_L_PathTable()); System.out.println(" - Location of M PathTable : " + this.getLocationOfTyp_M_PathTable()); System.out.println(" - Location of Optional M PathTable : " + this.getLocationOfOptionalTyp_M_PathTable()); System.out.println(" - Root directory entry: " ); System.out.println(" - Size: " + this.getRootDirectoryEntry().getLengthOfDirectoryEntry()); System.out.println(" - Extended attribute size: " + this.getRootDirectoryEntry().getLengthOfExtendedAttribute()); System.out.println(" - Location of the extent: " + this.getRootDirectoryEntry().getLocationOfExtent()); System.out.println(" - Length of the file identifier: " + this.getRootDirectoryEntry().getLengthOfFileIdentifier()); System.out.println(" - is directory: " + this.getRootDirectoryEntry().isDirectory()); System.out.println(" - File identifier: " + this.getRootDirectoryEntry().getFileIdentifier()); System.out.println(" - Data Length: " + this.getRootDirectoryEntry().getDataLength()); System.out.println(" - File unit size: " + this.getRootDirectoryEntry().getFileUnitSize()); } |
final int pos = screen.getRowColFromPoint(me.getX(),me.getY()) - (screen.getCols()-1); | final int pos = screen.getRowColFromPoint(me.getX(),me.getY()); | private void doPopup (MouseEvent me) { JMenuItem menuItem; Action action; popup = new JPopupMenu(); final Gui5250 g = this; JMenuItem mi; final int pos = screen.getRowColFromPoint(me.getX(),me.getY()) - (screen.getCols()-1); if (!rubberband.isAreaSelected() && screen.isInField(pos,false) ) { action = new AbstractAction(LangTool.getString("popup.copy")) { public void actionPerformed(ActionEvent e) { screen.copyField(pos); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_COPY)); action = new AbstractAction(LangTool.getString("popup.paste")) { public void actionPerformed(ActionEvent e) { screen.sendKeys(MNEMONIC_PASTE); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PASTE)); action = new AbstractAction(LangTool.getString("popup.pasteSpecial")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(true); getFocusForMe(); } }; popup.add(action); popup.addSeparator(); } else { action = new AbstractAction(LangTool.getString("popup.copy")) { public void actionPerformed(ActionEvent e) { screen.sendKeys(MNEMONIC_COPY); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_COPY)); action = new AbstractAction(LangTool.getString("popup.paste")) { public void actionPerformed(ActionEvent e) { screen.sendKeys(MNEMONIC_PASTE); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PASTE)); action = new AbstractAction(LangTool.getString("popup.pasteSpecial")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(true); getFocusForMe(); } }; popup.add(action); Rectangle workR = new Rectangle(); if (rubberband.isAreaSelected()) { rubberband.getBoundingArea(workR); // get the width and height int ePos = screen.getRowColFromPoint(workR.width , workR.height ); popup.addSeparator(); menuItem = new JMenuItem(LangTool.getString("popup.selectedColumns") + " " + screen.getCol(ePos)); menuItem.setArmed(false); popup.add(menuItem); menuItem = new JMenuItem(LangTool.getString("popup.selectedRows") + " " + screen.getRow(ePos)); menuItem.setArmed(false); popup.add(menuItem); JMenu sumMenu = new JMenu(LangTool.getString("popup.calc")); popup.add(sumMenu); action = new AbstractAction(LangTool.getString("popup.calcGroupCD")) { public void actionPerformed(ActionEvent e) { sumArea(true); } }; sumMenu.add(action); action = new AbstractAction(LangTool.getString("popup.calcGroupDC")) { public void actionPerformed(ActionEvent e) { sumArea(false); } }; sumMenu.add(action); } popup.addSeparator(); action = new AbstractAction(LangTool.getString("popup.printScreen")) { public void actionPerformed(ActionEvent e) { screen.printMe(); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PRINT_SCREEN)); popup.addSeparator(); JMenu kbMenu = new JMenu(LangTool.getString("popup.keyboard")); popup.add(kbMenu); action = new AbstractAction(LangTool.getString("popup.mapKeys")) { public void actionPerformed(ActionEvent e) { mapMeKeys(); } }; kbMenu.add(action); kbMenu.addSeparator(); action = new AbstractAction(LangTool.getString("key.[attn]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[attn]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_ATTN)); action = new AbstractAction(LangTool.getString("key.[reset]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[reset]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_RESET)); action = new AbstractAction(LangTool.getString("key.[sysreq]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[sysreq]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_SYSREQ)); if (screen.isMessageWait()) { action = new AbstractAction(LangTool.getString("popup.displayMessages")) { public void actionPerformed(ActionEvent e) { vt.systemRequest('4'); } }; kbMenu.add(createMenuItem(action,MNEMONIC_DISP_MESSAGES)); } kbMenu.addSeparator(); action = new AbstractAction(LangTool.getString("key.[dupfield]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[dupfield]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_DUP_FIELD)); action = new AbstractAction(LangTool.getString("key.[help]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[help]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_HELP)); action = new AbstractAction(LangTool.getString("key.[eraseeof]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[eraseeof]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_ERASE_EOF)); action = new AbstractAction(LangTool.getString("key.[field+]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[field+]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_FIELD_PLUS)); action = new AbstractAction(LangTool.getString("key.[field-]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[field-]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_FIELD_MINUS)); action = new AbstractAction(LangTool.getString("key.[newline]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[newline]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_NEW_LINE)); action = new AbstractAction(LangTool.getString("popup.hostPrint")) { public void actionPerformed(ActionEvent e) { vt.hostPrint(1); } }; kbMenu.add(createMenuItem(action,MNEMONIC_PRINT)); createShortCutItems(kbMenu); if (screen.isMessageWait()) { action = new AbstractAction(LangTool.getString("popup.displayMessages")) { public void actionPerformed(ActionEvent e) { vt.systemRequest('4'); } }; popup.add(createMenuItem(action,MNEMONIC_DISP_MESSAGES)); } popup.addSeparator(); action = new AbstractAction(LangTool.getString("popup.hexMap")) { public void actionPerformed(ActionEvent e) { showHexMap(); getFocusForMe(); } }; popup.add(createMenuItem(action,"")); action = new AbstractAction(LangTool.getString("popup.mapKeys")) { public void actionPerformed(ActionEvent e) { mapMeKeys(); getFocusForMe(); } }; popup.add(createMenuItem(action,"")); action = new AbstractAction(LangTool.getString("popup.settings")) { public void actionPerformed(ActionEvent e) { doAttributes(); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_DISP_ATTRIBUTES)); popup.addSeparator(); if (isMacroRunning()) { action = new AbstractAction(LangTool.getString("popup.stopScript")) { public void actionPerformed(ActionEvent e) { setStopMacroRequested(); } }; popup.add(action); } else { JMenu macMenu = new JMenu(LangTool.getString("popup.macros")); if (recording) { action = new AbstractAction(LangTool.getString("popup.stop")) { public void actionPerformed(ActionEvent e) { stopRecordingMe(); getFocusForMe(); } }; } else { action = new AbstractAction(LangTool.getString("popup.record")) { public void actionPerformed(ActionEvent e) { startRecordingMe(); getFocusForMe(); } }; } macMenu.add(action); if (macros.isMacrosExist()) { // this will add a sorted list of the macros to the macro menu addMacros(macMenu); } popup.add(macMenu); } popup.addSeparator(); action = new AbstractAction(LangTool.getString("popup.xtfrFile")) { public void actionPerformed(ActionEvent e) { doMeTransfer(); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_FILE_TRANSFER)); JMenu sendMenu = new JMenu(LangTool.getString("popup.send")); popup.add(sendMenu); action = new AbstractAction(LangTool.getString("popup.email")) { public void actionPerformed(ActionEvent e) { sendScreenEMail(); getFocusForMe(); } }; sendMenu.add(createMenuItem(action,MNEMONIC_E_MAIL)); action = new AbstractAction(LangTool.getString("popup.file")) { public void actionPerformed(ActionEvent e) { sendMeToFile(); } }; sendMenu.add(action); popup.addSeparator(); } action = new AbstractAction(LangTool.getString("popup.connections")) { public void actionPerformed(ActionEvent e) { doConnections(); } }; popup.add(createMenuItem(action,MNEMONIC_OPEN_NEW)); popup.addSeparator(); if (vt.isConnected()) { action = new AbstractAction(LangTool.getString("popup.disconnect")) { public void actionPerformed(ActionEvent e) { changeConnection(); getFocusForMe(); } }; } else { action = new AbstractAction(LangTool.getString("popup.connect")) { public void actionPerformed(ActionEvent e) { changeConnection(); getFocusForMe(); } }; } popup.add(createMenuItem(action,MNEMONIC_TOGGLE_CONNECTION)); action = new AbstractAction(LangTool.getString("popup.close")) { public void actionPerformed(ActionEvent e) { closeSession(); } }; popup.add(createMenuItem(action,MNEMONIC_CLOSE)); popup.show(me.getComponent(), me.getX(),me.getY()); } |
int ePos = screen.getRowColFromPoint(workR.width , workR.height ); | int ePos = screen.getRowColFromPoint(workR.width + 1 , workR.height + 1 ); | private void doPopup (MouseEvent me) { JMenuItem menuItem; Action action; popup = new JPopupMenu(); final Gui5250 g = this; JMenuItem mi; final int pos = screen.getRowColFromPoint(me.getX(),me.getY()) - (screen.getCols()-1); if (!rubberband.isAreaSelected() && screen.isInField(pos,false) ) { action = new AbstractAction(LangTool.getString("popup.copy")) { public void actionPerformed(ActionEvent e) { screen.copyField(pos); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_COPY)); action = new AbstractAction(LangTool.getString("popup.paste")) { public void actionPerformed(ActionEvent e) { screen.sendKeys(MNEMONIC_PASTE); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PASTE)); action = new AbstractAction(LangTool.getString("popup.pasteSpecial")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(true); getFocusForMe(); } }; popup.add(action); popup.addSeparator(); } else { action = new AbstractAction(LangTool.getString("popup.copy")) { public void actionPerformed(ActionEvent e) { screen.sendKeys(MNEMONIC_COPY); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_COPY)); action = new AbstractAction(LangTool.getString("popup.paste")) { public void actionPerformed(ActionEvent e) { screen.sendKeys(MNEMONIC_PASTE); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PASTE)); action = new AbstractAction(LangTool.getString("popup.pasteSpecial")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(true); getFocusForMe(); } }; popup.add(action); Rectangle workR = new Rectangle(); if (rubberband.isAreaSelected()) { rubberband.getBoundingArea(workR); // get the width and height int ePos = screen.getRowColFromPoint(workR.width , workR.height ); popup.addSeparator(); menuItem = new JMenuItem(LangTool.getString("popup.selectedColumns") + " " + screen.getCol(ePos)); menuItem.setArmed(false); popup.add(menuItem); menuItem = new JMenuItem(LangTool.getString("popup.selectedRows") + " " + screen.getRow(ePos)); menuItem.setArmed(false); popup.add(menuItem); JMenu sumMenu = new JMenu(LangTool.getString("popup.calc")); popup.add(sumMenu); action = new AbstractAction(LangTool.getString("popup.calcGroupCD")) { public void actionPerformed(ActionEvent e) { sumArea(true); } }; sumMenu.add(action); action = new AbstractAction(LangTool.getString("popup.calcGroupDC")) { public void actionPerformed(ActionEvent e) { sumArea(false); } }; sumMenu.add(action); } popup.addSeparator(); action = new AbstractAction(LangTool.getString("popup.printScreen")) { public void actionPerformed(ActionEvent e) { screen.printMe(); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PRINT_SCREEN)); popup.addSeparator(); JMenu kbMenu = new JMenu(LangTool.getString("popup.keyboard")); popup.add(kbMenu); action = new AbstractAction(LangTool.getString("popup.mapKeys")) { public void actionPerformed(ActionEvent e) { mapMeKeys(); } }; kbMenu.add(action); kbMenu.addSeparator(); action = new AbstractAction(LangTool.getString("key.[attn]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[attn]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_ATTN)); action = new AbstractAction(LangTool.getString("key.[reset]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[reset]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_RESET)); action = new AbstractAction(LangTool.getString("key.[sysreq]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[sysreq]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_SYSREQ)); if (screen.isMessageWait()) { action = new AbstractAction(LangTool.getString("popup.displayMessages")) { public void actionPerformed(ActionEvent e) { vt.systemRequest('4'); } }; kbMenu.add(createMenuItem(action,MNEMONIC_DISP_MESSAGES)); } kbMenu.addSeparator(); action = new AbstractAction(LangTool.getString("key.[dupfield]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[dupfield]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_DUP_FIELD)); action = new AbstractAction(LangTool.getString("key.[help]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[help]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_HELP)); action = new AbstractAction(LangTool.getString("key.[eraseeof]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[eraseeof]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_ERASE_EOF)); action = new AbstractAction(LangTool.getString("key.[field+]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[field+]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_FIELD_PLUS)); action = new AbstractAction(LangTool.getString("key.[field-]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[field-]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_FIELD_MINUS)); action = new AbstractAction(LangTool.getString("key.[newline]")) { public void actionPerformed(ActionEvent e) { screen.sendKeys("[newline]"); } }; kbMenu.add(createMenuItem(action,MNEMONIC_NEW_LINE)); action = new AbstractAction(LangTool.getString("popup.hostPrint")) { public void actionPerformed(ActionEvent e) { vt.hostPrint(1); } }; kbMenu.add(createMenuItem(action,MNEMONIC_PRINT)); createShortCutItems(kbMenu); if (screen.isMessageWait()) { action = new AbstractAction(LangTool.getString("popup.displayMessages")) { public void actionPerformed(ActionEvent e) { vt.systemRequest('4'); } }; popup.add(createMenuItem(action,MNEMONIC_DISP_MESSAGES)); } popup.addSeparator(); action = new AbstractAction(LangTool.getString("popup.hexMap")) { public void actionPerformed(ActionEvent e) { showHexMap(); getFocusForMe(); } }; popup.add(createMenuItem(action,"")); action = new AbstractAction(LangTool.getString("popup.mapKeys")) { public void actionPerformed(ActionEvent e) { mapMeKeys(); getFocusForMe(); } }; popup.add(createMenuItem(action,"")); action = new AbstractAction(LangTool.getString("popup.settings")) { public void actionPerformed(ActionEvent e) { doAttributes(); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_DISP_ATTRIBUTES)); popup.addSeparator(); if (isMacroRunning()) { action = new AbstractAction(LangTool.getString("popup.stopScript")) { public void actionPerformed(ActionEvent e) { setStopMacroRequested(); } }; popup.add(action); } else { JMenu macMenu = new JMenu(LangTool.getString("popup.macros")); if (recording) { action = new AbstractAction(LangTool.getString("popup.stop")) { public void actionPerformed(ActionEvent e) { stopRecordingMe(); getFocusForMe(); } }; } else { action = new AbstractAction(LangTool.getString("popup.record")) { public void actionPerformed(ActionEvent e) { startRecordingMe(); getFocusForMe(); } }; } macMenu.add(action); if (macros.isMacrosExist()) { // this will add a sorted list of the macros to the macro menu addMacros(macMenu); } popup.add(macMenu); } popup.addSeparator(); action = new AbstractAction(LangTool.getString("popup.xtfrFile")) { public void actionPerformed(ActionEvent e) { doMeTransfer(); getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_FILE_TRANSFER)); JMenu sendMenu = new JMenu(LangTool.getString("popup.send")); popup.add(sendMenu); action = new AbstractAction(LangTool.getString("popup.email")) { public void actionPerformed(ActionEvent e) { sendScreenEMail(); getFocusForMe(); } }; sendMenu.add(createMenuItem(action,MNEMONIC_E_MAIL)); action = new AbstractAction(LangTool.getString("popup.file")) { public void actionPerformed(ActionEvent e) { sendMeToFile(); } }; sendMenu.add(action); popup.addSeparator(); } action = new AbstractAction(LangTool.getString("popup.connections")) { public void actionPerformed(ActionEvent e) { doConnections(); } }; popup.add(createMenuItem(action,MNEMONIC_OPEN_NEW)); popup.addSeparator(); if (vt.isConnected()) { action = new AbstractAction(LangTool.getString("popup.disconnect")) { public void actionPerformed(ActionEvent e) { changeConnection(); getFocusForMe(); } }; } else { action = new AbstractAction(LangTool.getString("popup.connect")) { public void actionPerformed(ActionEvent e) { changeConnection(); getFocusForMe(); } }; } popup.add(createMenuItem(action,MNEMONIC_TOGGLE_CONNECTION)); action = new AbstractAction(LangTool.getString("popup.close")) { public void actionPerformed(ActionEvent e) { closeSession(); } }; popup.add(createMenuItem(action,MNEMONIC_CLOSE)); popup.show(me.getComponent(), me.getX(),me.getY()); } |
filledSlider = UIManager.getBoolean(SLIDER_FILL); | public MetalSliderUI() { super(null); } |
|
row = 0; sb = new StringBuffer(); | public void createFileInstance(String fileName) throws FileNotFoundException { fout = new ZipOutputStream(new FileOutputStream(fileName)); fout.setMethod(ZipOutputStream.DEFLATED); writeManifestEntry(); } |
|
VirtualStack vstack, X86RegisterPool pool) { | VirtualStack vstack, X86RegisterPool pool, ItemFactory ifac) { | EmitterContext(AbstractX86Stream os, X86CompilerHelper helper, VirtualStack vstack, X86RegisterPool pool) { this.os = os; this.helper = helper; this.vstack = vstack; this.pool = pool; } |
this.itemfac = ifac; | EmitterContext(AbstractX86Stream os, X86CompilerHelper helper, VirtualStack vstack, X86RegisterPool pool) { this.os = os; this.helper = helper; this.vstack = vstack; this.pool = pool; } |
|
X86CompilerHelper getHelper() { | final X86CompilerHelper getHelper() { | X86CompilerHelper getHelper() { return helper; } |
X86RegisterPool getPool() { | final X86RegisterPool getPool() { | X86RegisterPool getPool() { return pool; } |
AbstractX86Stream getStream() { | final AbstractX86Stream getStream() { | AbstractX86Stream getStream() { return os; } |
VirtualStack getVStack() { | final VirtualStack getVStack() { | VirtualStack getVStack() { return vstack; } |
bad.minor = Minor.Any; | public static WrongAdapter extract(Any any) { try { EmptyExceptionHolder h = (EmptyExceptionHolder) any.extract_Streamable(); return (WrongAdapter) h.value; } catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("WrongAdapter expected"); bad.initCause(cex); throw bad; } } |
|
ic.imageComplete(ImageConsumer.SINGLEFRAME); | ic.imageComplete(ImageConsumer.SINGLEFRAMEDONE); | public void startProduction(ImageConsumer ic) { if (! (consumers.contains(ic))) consumers.addElement(ic); Vector list = (Vector) consumers.clone(); for (int i = 0; i < list.size(); i++) { ic = (ImageConsumer) list.elementAt(i); sendPicture(ic); if (animated) ic.imageComplete(ImageConsumer.SINGLEFRAME); else ic.imageComplete(ImageConsumer.STATICIMAGEDONE); } } |
throw new BAD_OPERATION(); | BAD_OPERATION bad = new BAD_OPERATION(); bad.initCause(ex); bad.minor = Minor.Any; throw bad; | public static AlreadyBound extract(Any a) { try { return ((AlreadyBoundHolder) a.extract_Streamable()).value; } catch (ClassCastException ex) { throw new BAD_OPERATION(); } } |
bad.minor = Minor.Any; | public static InvalidName extract(Any any) { try { EmptyExceptionHolder h = (EmptyExceptionHolder) any.extract_Streamable(); return (InvalidName) h.value; } catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("InvalidName expected"); bad.initCause(cex); throw bad; } } |
|
AxisReadOrder.add(AxisObj.get(attrs.getValue(i))); | AxisReadOrder.add(0, AxisObj.get(attrs.getValue(i))); | public Object action (SaxDocumentHandler handler, AttributeList attrs) { // for node sets the iteration order for how we will setData // in the datacube (important for delimited and formatted reads). int size = attrs.getLength(); for (int i = 0; i < size; i++) { String name = attrs.getName(i); if (name.equals("axisIdRef") ) { AxisReadOrder.add(AxisObj.get(attrs.getValue(i))); } else Log.warnln("Warning: got weird attribute:"+name+" on for node"); } return (Object) null; } |
newparameter = CurrentArray.addParameter(newparameter); | newparameter = (Parameter) CurrentArray.addParameter(newparameter); | public Object action (SaxDocumentHandler handler, AttributeList attrs) { // grab parent node name String parentNodeName = getParentNodeName(); // create new object appropriately Parameter newparameter = new Parameter(); newparameter.setXMLAttributes(attrs); // set XML attributes from passed list // add this object to the lookup table, if it has an ID String paramId = newparameter.getParamId(); if (paramId != null) { // a warning check, just in case if (ParamObj.containsKey(paramId)) Log.warnln("More than one param node with paramId=\""+paramId+"\", using latest node." ); // add this into the list of param objects ParamObj.put(paramId, newparameter); } // If there is a reference object, clone it to get // the new param String paramIdRef = newparameter.getParamIdRef(); if (paramIdRef != null) { if (ParamObj.containsKey(paramIdRef)) { Parameter refParamObj = (Parameter) ParamObj.get(paramIdRef); try { newparameter = (Parameter) refParamObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone param object. Aborting read."); System.exit(-1); } // override attrs with those in passed list newparameter.setXMLAttributes(attrs); // give the clone a unique Id and remove IdRef newparameter.setParamId(findUniqueIdName(ParamObj,newparameter.getParamId())); newparameter.setParamIdRef(null); // add this into the list of param objects ParamObj.put(newparameter.getParamId(), newparameter); } else { Log.warnln("Error: Reader got an param with ParamIdRef=\""+paramIdRef+"\" but no previous param has that id! Ignoring add param request."); return (Object) null; } } // determine where this goes and then insert it if( parentNodeName.equals(XDFNodeName.ARRAY) ) { newparameter = CurrentArray.addParameter(newparameter); } else if ( parentNodeName.equals(XDFNodeName.ROOT) || parentNodeName.equals(XDFNodeName.STRUCTURE) ) { newparameter = CurrentStructure.addParameter(newparameter); } else if ( parentNodeName.equals(XDFNodeName.PARAMETERGROUP) ) { // for now, just add as regular parameter if(LastParameterGroupParentObject instanceof Array) { newparameter = ((Array) LastParameterGroupParentObject).addParameter(newparameter); } else if(LastParameterGroupParentObject instanceof Structure) { newparameter = ((Structure) LastParameterGroupParentObject).addParameter(newparameter); } } else { Log.warnln("Error: weird parent node "+parentNodeName+" for parameter, ignoring"); return (Object) null; } // add this object to all open groups Iterator iter = CurrentParameterGroupList.iterator(); while (iter.hasNext()) { ParameterGroup nextParamGroupObj = (ParameterGroup) iter.next(); newparameter.addToGroup(nextParamGroupObj); } LastParameterObject = newparameter; return newparameter; } |
newparameter = CurrentStructure.addParameter(newparameter); | newparameter = (Parameter) CurrentStructure.addParameter(newparameter); | public Object action (SaxDocumentHandler handler, AttributeList attrs) { // grab parent node name String parentNodeName = getParentNodeName(); // create new object appropriately Parameter newparameter = new Parameter(); newparameter.setXMLAttributes(attrs); // set XML attributes from passed list // add this object to the lookup table, if it has an ID String paramId = newparameter.getParamId(); if (paramId != null) { // a warning check, just in case if (ParamObj.containsKey(paramId)) Log.warnln("More than one param node with paramId=\""+paramId+"\", using latest node." ); // add this into the list of param objects ParamObj.put(paramId, newparameter); } // If there is a reference object, clone it to get // the new param String paramIdRef = newparameter.getParamIdRef(); if (paramIdRef != null) { if (ParamObj.containsKey(paramIdRef)) { Parameter refParamObj = (Parameter) ParamObj.get(paramIdRef); try { newparameter = (Parameter) refParamObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone param object. Aborting read."); System.exit(-1); } // override attrs with those in passed list newparameter.setXMLAttributes(attrs); // give the clone a unique Id and remove IdRef newparameter.setParamId(findUniqueIdName(ParamObj,newparameter.getParamId())); newparameter.setParamIdRef(null); // add this into the list of param objects ParamObj.put(newparameter.getParamId(), newparameter); } else { Log.warnln("Error: Reader got an param with ParamIdRef=\""+paramIdRef+"\" but no previous param has that id! Ignoring add param request."); return (Object) null; } } // determine where this goes and then insert it if( parentNodeName.equals(XDFNodeName.ARRAY) ) { newparameter = CurrentArray.addParameter(newparameter); } else if ( parentNodeName.equals(XDFNodeName.ROOT) || parentNodeName.equals(XDFNodeName.STRUCTURE) ) { newparameter = CurrentStructure.addParameter(newparameter); } else if ( parentNodeName.equals(XDFNodeName.PARAMETERGROUP) ) { // for now, just add as regular parameter if(LastParameterGroupParentObject instanceof Array) { newparameter = ((Array) LastParameterGroupParentObject).addParameter(newparameter); } else if(LastParameterGroupParentObject instanceof Structure) { newparameter = ((Structure) LastParameterGroupParentObject).addParameter(newparameter); } } else { Log.warnln("Error: weird parent node "+parentNodeName+" for parameter, ignoring"); return (Object) null; } // add this object to all open groups Iterator iter = CurrentParameterGroupList.iterator(); while (iter.hasNext()) { ParameterGroup nextParamGroupObj = (ParameterGroup) iter.next(); newparameter.addToGroup(nextParamGroupObj); } LastParameterObject = newparameter; return newparameter; } |
newparameter = ((Array) LastParameterGroupParentObject).addParameter(newparameter); | newparameter = (Parameter) ((Array) LastParameterGroupParentObject).addParameter(newparameter); | public Object action (SaxDocumentHandler handler, AttributeList attrs) { // grab parent node name String parentNodeName = getParentNodeName(); // create new object appropriately Parameter newparameter = new Parameter(); newparameter.setXMLAttributes(attrs); // set XML attributes from passed list // add this object to the lookup table, if it has an ID String paramId = newparameter.getParamId(); if (paramId != null) { // a warning check, just in case if (ParamObj.containsKey(paramId)) Log.warnln("More than one param node with paramId=\""+paramId+"\", using latest node." ); // add this into the list of param objects ParamObj.put(paramId, newparameter); } // If there is a reference object, clone it to get // the new param String paramIdRef = newparameter.getParamIdRef(); if (paramIdRef != null) { if (ParamObj.containsKey(paramIdRef)) { Parameter refParamObj = (Parameter) ParamObj.get(paramIdRef); try { newparameter = (Parameter) refParamObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone param object. Aborting read."); System.exit(-1); } // override attrs with those in passed list newparameter.setXMLAttributes(attrs); // give the clone a unique Id and remove IdRef newparameter.setParamId(findUniqueIdName(ParamObj,newparameter.getParamId())); newparameter.setParamIdRef(null); // add this into the list of param objects ParamObj.put(newparameter.getParamId(), newparameter); } else { Log.warnln("Error: Reader got an param with ParamIdRef=\""+paramIdRef+"\" but no previous param has that id! Ignoring add param request."); return (Object) null; } } // determine where this goes and then insert it if( parentNodeName.equals(XDFNodeName.ARRAY) ) { newparameter = CurrentArray.addParameter(newparameter); } else if ( parentNodeName.equals(XDFNodeName.ROOT) || parentNodeName.equals(XDFNodeName.STRUCTURE) ) { newparameter = CurrentStructure.addParameter(newparameter); } else if ( parentNodeName.equals(XDFNodeName.PARAMETERGROUP) ) { // for now, just add as regular parameter if(LastParameterGroupParentObject instanceof Array) { newparameter = ((Array) LastParameterGroupParentObject).addParameter(newparameter); } else if(LastParameterGroupParentObject instanceof Structure) { newparameter = ((Structure) LastParameterGroupParentObject).addParameter(newparameter); } } else { Log.warnln("Error: weird parent node "+parentNodeName+" for parameter, ignoring"); return (Object) null; } // add this object to all open groups Iterator iter = CurrentParameterGroupList.iterator(); while (iter.hasNext()) { ParameterGroup nextParamGroupObj = (ParameterGroup) iter.next(); newparameter.addToGroup(nextParamGroupObj); } LastParameterObject = newparameter; return newparameter; } |
newparameter = ((Structure) LastParameterGroupParentObject).addParameter(newparameter); | newparameter = (Parameter) ((Structure) LastParameterGroupParentObject).addParameter(newparameter); | public Object action (SaxDocumentHandler handler, AttributeList attrs) { // grab parent node name String parentNodeName = getParentNodeName(); // create new object appropriately Parameter newparameter = new Parameter(); newparameter.setXMLAttributes(attrs); // set XML attributes from passed list // add this object to the lookup table, if it has an ID String paramId = newparameter.getParamId(); if (paramId != null) { // a warning check, just in case if (ParamObj.containsKey(paramId)) Log.warnln("More than one param node with paramId=\""+paramId+"\", using latest node." ); // add this into the list of param objects ParamObj.put(paramId, newparameter); } // If there is a reference object, clone it to get // the new param String paramIdRef = newparameter.getParamIdRef(); if (paramIdRef != null) { if (ParamObj.containsKey(paramIdRef)) { Parameter refParamObj = (Parameter) ParamObj.get(paramIdRef); try { newparameter = (Parameter) refParamObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone param object. Aborting read."); System.exit(-1); } // override attrs with those in passed list newparameter.setXMLAttributes(attrs); // give the clone a unique Id and remove IdRef newparameter.setParamId(findUniqueIdName(ParamObj,newparameter.getParamId())); newparameter.setParamIdRef(null); // add this into the list of param objects ParamObj.put(newparameter.getParamId(), newparameter); } else { Log.warnln("Error: Reader got an param with ParamIdRef=\""+paramIdRef+"\" but no previous param has that id! Ignoring add param request."); return (Object) null; } } // determine where this goes and then insert it if( parentNodeName.equals(XDFNodeName.ARRAY) ) { newparameter = CurrentArray.addParameter(newparameter); } else if ( parentNodeName.equals(XDFNodeName.ROOT) || parentNodeName.equals(XDFNodeName.STRUCTURE) ) { newparameter = CurrentStructure.addParameter(newparameter); } else if ( parentNodeName.equals(XDFNodeName.PARAMETERGROUP) ) { // for now, just add as regular parameter if(LastParameterGroupParentObject instanceof Array) { newparameter = ((Array) LastParameterGroupParentObject).addParameter(newparameter); } else if(LastParameterGroupParentObject instanceof Structure) { newparameter = ((Structure) LastParameterGroupParentObject).addParameter(newparameter); } } else { Log.warnln("Error: weird parent node "+parentNodeName+" for parameter, ignoring"); return (Object) null; } // add this object to all open groups Iterator iter = CurrentParameterGroupList.iterator(); while (iter.hasNext()) { ParameterGroup nextParamGroupObj = (ParameterGroup) iter.next(); newparameter.addToGroup(nextParamGroupObj); } LastParameterObject = newparameter; return newparameter; } |
CurrentStructure = XDF; | setCurrentStructure(XDF); | public Object action (SaxDocumentHandler handler, AttributeList attrs) { // The root node is just a "structure" node, // but is always the first one. XDF.setXMLAttributes(attrs); // set XML attributes from passed list CurrentStructure = XDF; // current working structure is now the root // structure // if this global option is set in the reader, we use it if(Options.contains("DefaultDataDimensionSize")) { int value = ((Integer) Options.get("DefaultDataDimensionSize")).intValue(); Specification.getInstance().setDefaultDataArraySize(value); } return CurrentStructure; } |
private Array appendArrayToArray (Array arrayToAppendTo, Array arrayToAdd) { | private ArrayInterface appendArrayToArray ( ArrayInterface arrayToAppendTo, ArrayInterface arrayToAdd ) { | private Array appendArrayToArray (Array arrayToAppendTo, Array arrayToAdd) { if (arrayToAppendTo != null) { List origAxisList = arrayToAppendTo.getAxes(); List addAxisList = arrayToAdd.getAxes(); Hashtable correspondingAddAxis = new Hashtable(); Hashtable correspondingOrigAxis = new Hashtable(); // 1. determine the proper alignment of the axes between both arrays // Then cross-reference each in lookup Hashtables. Iterator iter = origAxisList.iterator(); while (iter.hasNext()) { AxisInterface origAxis = (AxisInterface) iter.next(); String align = origAxis.getAlign(); // search the list of the other array for a matching axis boolean gotAMatch = false; Iterator iter2 = addAxisList.iterator(); while (iter2.hasNext()) { AxisInterface addAxis = (AxisInterface) iter2.next(); String thisAlign = addAxis.getAlign(); if(thisAlign != null) { if(thisAlign.equals(align)) { correspondingAddAxis.put(origAxis.getAxisId(), addAxis); correspondingOrigAxis.put(addAxis.getAxisId(), origAxis); gotAMatch = true; break; } } else { Log.errorln("Cant align axes, axis missing defined align attribute. Aborting."); return arrayToAppendTo; } } // no match?? then alignments are mis-specified. if (!gotAMatch) { Log.errorln("Cant align axes, axis has align attribute that is mis-specified. Aborting."); return arrayToAppendTo; } } // 2. "Append" axis values to original axis. Because // there are 2 different ways to add in data we either // have a pre-existing axis value, in which case we dont // need to expand the existing axis, or there is no pre-existing // value so we tack it in. We need to figure out here if an // axis value already exists, and if it doesnt then we add it in. // Iterator iter3 = origAxisList.iterator(); while (iter3.hasNext()) { AxisInterface origAxis = (AxisInterface) iter3.next(); AxisInterface addAxis = (AxisInterface) correspondingAddAxis.get(origAxis.getAxisId()); if (addAxis instanceof Axis && origAxis instanceof Axis) { List valuesToAdd = ((Axis) addAxis).getAxisValues(); Iterator iter4 = valuesToAdd.iterator(); while (iter4.hasNext()) { Value value = (Value) iter4.next(); if (((Axis) origAxis).getIndexFromAxisValue(value) == -1) { ((Axis) origAxis).addAxisValue(value); } } } else if (addAxis instanceof FieldAxis && origAxis instanceof FieldAxis) { // both are fieldAxis Log.errorln("Dont know how to merge field Axis data. Aborting."); System.exit(-1); } else { // mixed class Axes?? (e.g. a fieldAxis id matches Axis id??!? Error!!) Log.errorln("Dont know how to merge data. Aborting."); System.exit(-1); } } // 3. Append data from one array to the other appropriately Locator origLocator = arrayToAppendTo.createLocator(); Locator addLocator = arrayToAdd.createLocator(); while (addLocator.hasNext()) { try { // retrieve the data Object data = arrayToAdd.getData(addLocator); // set up the origLocator List locatorAxisList = addLocator.getIterationOrder(); Iterator iter5 = locatorAxisList.iterator(); Log.debug("Appending data to array("); while (iter5.hasNext()) { Axis addAxis = (Axis) iter5.next(); Value thisAxisValue = addLocator.getAxisValue(addAxis); Axis thisAxis = (Axis) correspondingOrigAxis.get(addAxis.getAxisId()); try { origLocator.setAxisIndexByAxisValue(thisAxis, thisAxisValue); Log.debug(origLocator.getAxisIndex(thisAxis)+","); } catch (AxisLocationOutOfBoundsException e) { Log.errorln("Weird axis out of bounds error for append array."); } } // add in the data as appropriate. Log.debugln(") => ["+data.toString()+"]"); try { if (data instanceof Double) arrayToAppendTo.setData(origLocator, (Double) data); else if (data instanceof Integer) arrayToAppendTo.setData(origLocator, (Integer) data); else if (data instanceof String ) arrayToAppendTo.setData(origLocator, (String) data); else Log.errorln("Cant understand class of data !(Double|Integer|String). ignoring append"); } catch (SetDataException e) { Log.errorln("Cant setData. Ignoring append"); } } catch (NoDataException e) { // do nothing for NoDataValues?? } addLocator.next(); // go to next location } } else Log.errorln("Cannot append to null array. Ignoring request."); return arrayToAppendTo; } |
public Array getCurrentArray () { | public ArrayInterface getCurrentArray () { | public Array getCurrentArray () { return CurrentArray; } |
public Structure getCurrentStructure () { | public StructureInterface getCurrentStructure () { | public Structure getCurrentStructure () { return CurrentStructure; } |
XDF = new Structure(); | XDF = new XDF(); | private void init () { // set up logging, needed ?? Log.configure("XDFLogConfig"); // assign/init 'globals' (e.g. object fields) XDF = new Structure(); Options = new Hashtable(); startElementHandlerHashtable = new Hashtable(); // start node handler charDataHandlerHashtable = new Hashtable(); // charData handler endElementHandlerHashtable = new Hashtable(); // end node handler // initialize the default XDF parser dispatch tables initStartHandlerHashtable(); initCharDataHandlerHashtable(); initEndHandlerHashtable(); } |
public void setCurrentArray(Array array) { | private void setCurrentArray(ArrayInterface array) { | public void setCurrentArray(Array array) { CurrentArray = array; } |
public void setCurrentDatatypeObject(Object object) { | private void setCurrentDatatypeObject(Object object) { | public void setCurrentDatatypeObject(Object object) { CurrentDatatypeObject = object; } |
public void setCurrentStructure (Structure structure) { | private void setCurrentStructure (StructureInterface structure) { | public void setCurrentStructure (Structure structure) { CurrentStructure = structure; } |
super(n, e); | this(Registry.RAW_ENCODING_ID, n, e); | public GnuRSAPublicKey(final BigInteger n, final BigInteger e) { // super(n); super(n, e); // // this.e = e; } |
throw new IllegalArgumentException("format"); | throw new IllegalArgumentException("Unsupported encoding format: " + format); | public byte[] getEncoded(final int format) { final byte[] result; switch (format) { case IKeyPairCodec.RAW_FORMAT: result = new RSAKeyPairRawCodec().encodePublicKey(this); break; default: throw new IllegalArgumentException("format"); } return result; } |
final IKeyPairCodec codec = new RSAKeyPairRawCodec(); return (GnuRSAPublicKey) codec.decodePublicKey(k); | return (GnuRSAPublicKey) new RSAKeyPairRawCodec().decodePublicKey(k); | public static GnuRSAPublicKey valueOf(final byte[] k) { // check magic... // we should parse here enough bytes to know which codec to use, and // direct the byte array to the appropriate codec. since we only have one // codec, we could have immediately tried it; nevertheless since testing // one byte is cheaper than instatiating a codec that will fail we test // the first byte before we carry on. if (k[0] == Registry.MAGIC_RAW_RSA_PUBLIC_KEY[0]) { // it's likely to be in raw format. get a raw codec and hand it over final IKeyPairCodec codec = new RSAKeyPairRawCodec(); return (GnuRSAPublicKey) codec.decodePublicKey(k); } else { throw new IllegalArgumentException("magic"); } } |
else | catch (IllegalArgumentException ignored) | public static GnuRSAPublicKey valueOf(final byte[] k) { // check magic... // we should parse here enough bytes to know which codec to use, and // direct the byte array to the appropriate codec. since we only have one // codec, we could have immediately tried it; nevertheless since testing // one byte is cheaper than instatiating a codec that will fail we test // the first byte before we carry on. if (k[0] == Registry.MAGIC_RAW_RSA_PUBLIC_KEY[0]) { // it's likely to be in raw format. get a raw codec and hand it over final IKeyPairCodec codec = new RSAKeyPairRawCodec(); return (GnuRSAPublicKey) codec.decodePublicKey(k); } else { throw new IllegalArgumentException("magic"); } } |
throw new IllegalArgumentException("magic"); | public static GnuRSAPublicKey valueOf(final byte[] k) { // check magic... // we should parse here enough bytes to know which codec to use, and // direct the byte array to the appropriate codec. since we only have one // codec, we could have immediately tried it; nevertheless since testing // one byte is cheaper than instatiating a codec that will fail we test // the first byte before we carry on. if (k[0] == Registry.MAGIC_RAW_RSA_PUBLIC_KEY[0]) { // it's likely to be in raw format. get a raw codec and hand it over final IKeyPairCodec codec = new RSAKeyPairRawCodec(); return (GnuRSAPublicKey) codec.decodePublicKey(k); } else { throw new IllegalArgumentException("magic"); } } |
|
return (GnuRSAPublicKey) new RSAKeyPairX509Codec().decodePublicKey(k); | public static GnuRSAPublicKey valueOf(final byte[] k) { // check magic... // we should parse here enough bytes to know which codec to use, and // direct the byte array to the appropriate codec. since we only have one // codec, we could have immediately tried it; nevertheless since testing // one byte is cheaper than instatiating a codec that will fail we test // the first byte before we carry on. if (k[0] == Registry.MAGIC_RAW_RSA_PUBLIC_KEY[0]) { // it's likely to be in raw format. get a raw codec and hand it over final IKeyPairCodec codec = new RSAKeyPairRawCodec(); return (GnuRSAPublicKey) codec.decodePublicKey(k); } else { throw new IllegalArgumentException("magic"); } } |
|
if (inf == null) throw new IOException("stream closed"); | public int available() throws IOException { return inf.finished() ? 0 : 1; } |
|
int len = 2048; if (n < len) len = (int) n; byte[] tmp = new byte[len]; return (long) read(tmp); | if (n == 0) return 0; int buflen = (int) Math.min(n, 2048); byte[] tmpbuf = new byte[buflen]; long skipped = 0L; while (n > 0L) { int numread = read(tmpbuf, 0, buflen); if (numread <= 0) break; n -= numread; skipped += numread; buflen = (int) Math.min(n, 2048); } return skipped; | public long skip(long n) throws IOException { if (n < 0) throw new IllegalArgumentException(); int len = 2048; if (n < len) len = (int) n; byte[] tmp = new byte[len]; return (long) read(tmp); } |
System.out.print("\n Buffer Dump of data from AS400: "); | log.info("\n Buffer Dump of data from AS400: "); | public void dump (byte[] abyte0) { try { System.out.print("\n Buffer Dump of data from AS400: "); dw.write("\r\n Buffer Dump of data from AS400: ".getBytes()); StringBuffer h = new StringBuffer(); for (int x = 0; x < abyte0.length; x++) { if (x % 16 == 0) { System.out.println(" " + h.toString()); dw.write((" " + h.toString() + "\r\n").getBytes()); h.setLength(0); h.append("+0000"); h.setLength(5 - Integer.toHexString(x).length()); h.append(Integer.toHexString(x).toUpperCase()); System.out.print(h.toString()); dw.write(h.toString().getBytes()); h.setLength(0); } char ac = codePage.ebcdic2uni(abyte0[x]); if (ac < ' ') h.append('.'); else h.append(ac); if (x % 4 == 0) { System.out.print(" "); dw.write((" ").getBytes()); } if (Integer.toHexString(abyte0[x] & 0xff).length() == 1){ System.out.print("0" + Integer.toHexString(abyte0[x] & 0xff).toUpperCase()); dw.write(("0" + Integer.toHexString(abyte0[x] & 0xff).toUpperCase()).getBytes()); } else { System.out.print(Integer.toHexString(abyte0[x] & 0xff).toUpperCase()); dw.write((Integer.toHexString(abyte0[x] & 0xff).toUpperCase()).getBytes()); } } System.out.println(); dw.write("\r\n".getBytes()); dw.flush(); } catch(EOFException _ex) { } catch(Exception _ex) { System.out.println("Cannot dump from host\n\r"); } } |
System.out.println("Cannot dump from host\n\r"); | log.warn("Cannot dump from host\n\r"); | public void dump (byte[] abyte0) { try { System.out.print("\n Buffer Dump of data from AS400: "); dw.write("\r\n Buffer Dump of data from AS400: ".getBytes()); StringBuffer h = new StringBuffer(); for (int x = 0; x < abyte0.length; x++) { if (x % 16 == 0) { System.out.println(" " + h.toString()); dw.write((" " + h.toString() + "\r\n").getBytes()); h.setLength(0); h.append("+0000"); h.setLength(5 - Integer.toHexString(x).length()); h.append(Integer.toHexString(x).toUpperCase()); System.out.print(h.toString()); dw.write(h.toString().getBytes()); h.setLength(0); } char ac = codePage.ebcdic2uni(abyte0[x]); if (ac < ' ') h.append('.'); else h.append(ac); if (x % 4 == 0) { System.out.print(" "); dw.write((" ").getBytes()); } if (Integer.toHexString(abyte0[x] & 0xff).length() == 1){ System.out.print("0" + Integer.toHexString(abyte0[x] & 0xff).toUpperCase()); dw.write(("0" + Integer.toHexString(abyte0[x] & 0xff).toUpperCase()).getBytes()); } else { System.out.print(Integer.toHexString(abyte0[x] & 0xff).toUpperCase()); dw.write((Integer.toHexString(abyte0[x] & 0xff).toUpperCase()).getBytes()); } } System.out.println(); dw.write("\r\n".getBytes()); dw.flush(); } catch(EOFException _ex) { } catch(Exception _ex) { System.out.println("Cannot dump from host\n\r"); } } |
log.debug("partial stream found"); | private final void loadStream(byte abyte0[], int i) throws IOException { int j = 0; int size = 0; if (saveStream == null) { j = (abyte0[i] & 0xff) << 8 | abyte0[i + 1] & 0xff; size = abyte0.length; } else { size = saveStream.length + abyte0.length; byte[] inter = new byte[size]; System.arraycopy(saveStream, 0, inter, 0, saveStream.length); System.arraycopy(abyte0, 0, inter, saveStream.length, abyte0.length); abyte0 = new byte[size]; System.arraycopy(inter, 0, abyte0, 0, size); saveStream = null; inter = null; j = (abyte0[i] & 0xff) << 8 | abyte0[i + 1] & 0xff;// System.out.println("partial stream found"); } if (j > size) { saveStream = new byte[abyte0.length]; System.arraycopy(abyte0, 0, saveStream, 0, abyte0.length);// System.out.println("partial stream saved"); } else { byte abyte1[]; try { abyte1 = new byte[j + 2]; System.arraycopy(abyte0, i, abyte1, 0, j + 2); dsq.put(new Stream5250(abyte1)); if(abyte0.length > abyte1.length + i) loadStream(abyte0, i + j + 2); } catch (Exception ex) { System.out.println("load stream error " + ex.getMessage()); // ex.printStackTrace(); // dump(abyte0); } } } |
|
log.debug("partial stream saved"); | private final void loadStream(byte abyte0[], int i) throws IOException { int j = 0; int size = 0; if (saveStream == null) { j = (abyte0[i] & 0xff) << 8 | abyte0[i + 1] & 0xff; size = abyte0.length; } else { size = saveStream.length + abyte0.length; byte[] inter = new byte[size]; System.arraycopy(saveStream, 0, inter, 0, saveStream.length); System.arraycopy(abyte0, 0, inter, saveStream.length, abyte0.length); abyte0 = new byte[size]; System.arraycopy(inter, 0, abyte0, 0, size); saveStream = null; inter = null; j = (abyte0[i] & 0xff) << 8 | abyte0[i + 1] & 0xff;// System.out.println("partial stream found"); } if (j > size) { saveStream = new byte[abyte0.length]; System.arraycopy(abyte0, 0, saveStream, 0, abyte0.length);// System.out.println("partial stream saved"); } else { byte abyte1[]; try { abyte1 = new byte[j + 2]; System.arraycopy(abyte0, i, abyte1, 0, j + 2); dsq.put(new Stream5250(abyte1)); if(abyte0.length > abyte1.length + i) loadStream(abyte0, i + j + 2); } catch (Exception ex) { System.out.println("load stream error " + ex.getMessage()); // ex.printStackTrace(); // dump(abyte0); } } } |
|
System.out.println("load stream error " + ex.getMessage()); | log.warn("load stream error " + ex.getMessage()); | private final void loadStream(byte abyte0[], int i) throws IOException { int j = 0; int size = 0; if (saveStream == null) { j = (abyte0[i] & 0xff) << 8 | abyte0[i + 1] & 0xff; size = abyte0.length; } else { size = saveStream.length + abyte0.length; byte[] inter = new byte[size]; System.arraycopy(saveStream, 0, inter, 0, saveStream.length); System.arraycopy(abyte0, 0, inter, saveStream.length, abyte0.length); abyte0 = new byte[size]; System.arraycopy(inter, 0, abyte0, 0, size); saveStream = null; inter = null; j = (abyte0[i] & 0xff) << 8 | abyte0[i + 1] & 0xff;// System.out.println("partial stream found"); } if (j > size) { saveStream = new byte[abyte0.length]; System.arraycopy(abyte0, 0, saveStream, 0, abyte0.length);// System.out.println("partial stream saved"); } else { byte abyte1[]; try { abyte1 = new byte[j + 2]; System.arraycopy(abyte0, i, abyte1, 0, j + 2); dsq.put(new Stream5250(abyte1)); if(abyte0.length > abyte1.length + i) loadStream(abyte0, i + j + 2); } catch (Exception ex) { System.out.println("load stream error " + ex.getMessage()); // ex.printStackTrace(); // dump(abyte0); } } } |
System.out.println(" run() " + ioef.getMessage()); | log.warn(" run() " + ioef.getMessage()); | public final void run() { boolean done = false; me = Thread.currentThread(); // load the first response screen try { loadStream(abyte2, 0); } catch (IOException ioef) { System.out.println(" run() " + ioef.getMessage()); } while (!done) { try { byte[] abyte0 = readIncoming(); // WVL - LDC : 16/07/2003 : TR.000345 // When the socket has been closed, the reading returns // no bytes (an empty byte arrray). // But the loadStream fails on this, so we check it here! if (abyte0.length > 0) { loadStream(abyte0, 0); } // WVL - LDC : 16/07/2003 : TR.000345 // Returning no bytes means the input buffer has // reached end-of-stream, so we do a disconnect! else { done = true; vt.disconnect(); } } catch (SocketException se) {// System.out.println(" DataStreamProducer thread interrupted and stopping " + se.getMessage()); System.out.println(" DataStreamProducer thread interrupted and stopping "); done = true; } catch (IOException ioe) {// System.out.println(ioe.getMessage()); if (me.isInterrupted()) done = true; } catch (Exception ex) { System.out.println(ex.getMessage()); if (me.isInterrupted()) done = true; } } } |
System.out.println(" DataStreamProducer thread interrupted and stopping "); | log.warn(" DataStreamProducer thread interrupted and stopping "); | public final void run() { boolean done = false; me = Thread.currentThread(); // load the first response screen try { loadStream(abyte2, 0); } catch (IOException ioef) { System.out.println(" run() " + ioef.getMessage()); } while (!done) { try { byte[] abyte0 = readIncoming(); // WVL - LDC : 16/07/2003 : TR.000345 // When the socket has been closed, the reading returns // no bytes (an empty byte arrray). // But the loadStream fails on this, so we check it here! if (abyte0.length > 0) { loadStream(abyte0, 0); } // WVL - LDC : 16/07/2003 : TR.000345 // Returning no bytes means the input buffer has // reached end-of-stream, so we do a disconnect! else { done = true; vt.disconnect(); } } catch (SocketException se) {// System.out.println(" DataStreamProducer thread interrupted and stopping " + se.getMessage()); System.out.println(" DataStreamProducer thread interrupted and stopping "); done = true; } catch (IOException ioe) {// System.out.println(ioe.getMessage()); if (me.isInterrupted()) done = true; } catch (Exception ex) { System.out.println(ex.getMessage()); if (me.isInterrupted()) done = true; } } } |
log.warn(ioe.getMessage()); | public final void run() { boolean done = false; me = Thread.currentThread(); // load the first response screen try { loadStream(abyte2, 0); } catch (IOException ioef) { System.out.println(" run() " + ioef.getMessage()); } while (!done) { try { byte[] abyte0 = readIncoming(); // WVL - LDC : 16/07/2003 : TR.000345 // When the socket has been closed, the reading returns // no bytes (an empty byte arrray). // But the loadStream fails on this, so we check it here! if (abyte0.length > 0) { loadStream(abyte0, 0); } // WVL - LDC : 16/07/2003 : TR.000345 // Returning no bytes means the input buffer has // reached end-of-stream, so we do a disconnect! else { done = true; vt.disconnect(); } } catch (SocketException se) {// System.out.println(" DataStreamProducer thread interrupted and stopping " + se.getMessage()); System.out.println(" DataStreamProducer thread interrupted and stopping "); done = true; } catch (IOException ioe) {// System.out.println(ioe.getMessage()); if (me.isInterrupted()) done = true; } catch (Exception ex) { System.out.println(ex.getMessage()); if (me.isInterrupted()) done = true; } } } |
|
System.out.println(ex.getMessage()); | log.warn(ex.getMessage()); | public final void run() { boolean done = false; me = Thread.currentThread(); // load the first response screen try { loadStream(abyte2, 0); } catch (IOException ioef) { System.out.println(" run() " + ioef.getMessage()); } while (!done) { try { byte[] abyte0 = readIncoming(); // WVL - LDC : 16/07/2003 : TR.000345 // When the socket has been closed, the reading returns // no bytes (an empty byte arrray). // But the loadStream fails on this, so we check it here! if (abyte0.length > 0) { loadStream(abyte0, 0); } // WVL - LDC : 16/07/2003 : TR.000345 // Returning no bytes means the input buffer has // reached end-of-stream, so we do a disconnect! else { done = true; vt.disconnect(); } } catch (SocketException se) {// System.out.println(" DataStreamProducer thread interrupted and stopping " + se.getMessage()); System.out.println(" DataStreamProducer thread interrupted and stopping "); done = true; } catch (IOException ioe) {// System.out.println(ioe.getMessage()); if (me.isInterrupted()) done = true; } catch (Exception ex) { System.out.println(ex.getMessage()); if (me.isInterrupted()) done = true; } } } |
getThread.yield(); | Thread.yield(); | public void run() { Socket socket = null; DataInputStream datainputstream = null; String localFileFull = localFileF; executeCommand("TYPE","I"); try { socket = createPassiveSocket("RETR " + remoteFileF); if(socket != null) { datainputstream = new DataInputStream(socket.getInputStream()); writeHeader(localFileFull); byte abyte0[] = new byte[recordLength]; StringBuffer rb = new StringBuffer(recordOutLength); int c = 0; int kj = 0; int len = 0; for(int j = 0; j != -1 && !aborted;) { j = datainputstream.read(); if(j == -1) break; c ++; abyte0[len++] = (byte)j; if (len == recordLength) { rb.setLength(0); parseFFD(abyte0,rb); len =0; status.setCurrentRecord(c / recordLength); fireStatusEvent(); } getThread.yield(); // if ((c / recordLength) == 200) // aborted = true; } System.out.println(c); if (c == 0) { status.setCurrentRecord(c); fireStatusEvent(); } else { if (!aborted) parseResponse(); } writeFooter();// parseResponse(); printFTPInfo("Transfer complete!"); } } catch(InterruptedIOException iioe) { printFTPInfo("Interrupted! " + iioe.getMessage()); } catch(Exception _ex) { printFTPInfo("Error! " + _ex); } finally { try { socket.close(); } catch(Exception _ex) { } try { datainputstream.close(); } catch(Exception _ex) { } try { writeFooter(); } catch(Exception _ex) { } disconnect(); } } |
public StackManagerImpl(X86RegisterPool pool) { | public StackManagerImpl(X86RegisterPool pool, ItemFactory ifac) { | public StackManagerImpl(X86RegisterPool pool) { this.pool = pool; } |
this.ifac = ifac; | public StackManagerImpl(X86RegisterPool pool) { this.pool = pool; } |
|
final Item item = WordItem.createReg(jvmType, reg); | final Item item = ifac.createReg(jvmType, reg); | public void writePUSH(int jvmType, Register reg) { final Item item = WordItem.createReg(jvmType, reg); Item.assertCondition(pool.request(reg, item), "request"); push(item); } |
final Item item; switch (jvmType) { case JvmType.LONG: item = LongItem.createReg(lsbReg, msbReg); break; case JvmType.DOUBLE: item = DoubleItem.createReg(lsbReg, msbReg); break; default: throw new IllegalArgumentException("Unknown JvmType " + jvmType); } | final Item item = ifac.createReg(jvmType, lsbReg, msbReg); | public void writePUSH64(int jvmType, Register lsbReg, Register msbReg) { final Item item; switch (jvmType) { case JvmType.LONG: item = LongItem.createReg(lsbReg, msbReg); break; case JvmType.DOUBLE: item = DoubleItem.createReg(lsbReg, msbReg); break; default: throw new IllegalArgumentException("Unknown JvmType " + jvmType); } Item.assertCondition(pool.request(lsbReg, item), "request-lsb"); Item.assertCondition(pool.request(msbReg, item), "request-msb"); push(item); } |
final AbstractX86StackManager createStackMgr(X86RegisterPool pool) { return new StackManagerImpl(pool); | final AbstractX86StackManager createStackMgr(X86RegisterPool pool, ItemFactory ifac) { return new StackManagerImpl(pool, ifac); | final AbstractX86StackManager createStackMgr(X86RegisterPool pool) { return new StackManagerImpl(pool); } |
final void pushAll(TypeStack tstack) { | final void pushAll(ItemFactory ifac, TypeStack tstack) { | final void pushAll(TypeStack tstack) { if ((tstack != null) && !tstack.isEmpty()) { final int size = tstack.size(); for (int i = 0; i < size; i++) { final int type = tstack.getType(i); final Item item = VirtualStack.createStack(type); push(item); if (VirtualStack.checkOperandStack) { operandStack.push(item); } } } } |
final Item item = VirtualStack.createStack(type); | final Item item = ifac.createStack(type); | final void pushAll(TypeStack tstack) { if ((tstack != null) && !tstack.isEmpty()) { final int size = tstack.size(); for (int i = 0; i < size; i++) { final int type = tstack.getType(i); final Item item = VirtualStack.createStack(type); push(item); if (VirtualStack.checkOperandStack) { operandStack.push(item); } } } } |
m.minor = Minor.UserException; | public TypeCode type() { InputStream in = null; try { OutputStream out = _request("_get_type", true); in = _invoke(out); return TypeCodeHelper.read(in); } catch (ApplicationException ex) { in = ex.getInputStream(); throw new org.omg.CORBA.MARSHAL(ex.getId()); } catch (RemarshalException rex) { return type(); } catch (UserException ex) { MARSHAL m = new MARSHAL(); m.initCause(ex); throw m; } finally { _releaseReply(in); } } |
|
return uiClassID; | return "ComboBoxUI"; | public String getUIClassID() { return uiClassID; } |
firePropertyChange(EDITABLE_CHANGED_PROPERTY, ! isEditable, isEditable); | firePropertyChange("editable", ! isEditable, isEditable); | public void setEditable(boolean editable) { if (isEditable != editable) { isEditable = editable; firePropertyChange(EDITABLE_CHANGED_PROPERTY, ! isEditable, isEditable); } } |
firePropertyChange(EDITOR_CHANGED_PROPERTY, oldEditor, editor); | firePropertyChange("editor", oldEditor, editor); | public void setEditor(ComboBoxEditor newEditor) { if (editor == newEditor) return; if (editor != null) editor.removeActionListener(this); ComboBoxEditor oldEditor = editor; editor = newEditor; if (editor != null) editor.addActionListener(this); firePropertyChange(EDITOR_CHANGED_PROPERTY, oldEditor, editor); } |
firePropertyChange(ENABLED_CHANGED_PROPERTY, oldEnabled, (boolean) enabled); | firePropertyChange("enabled", oldEnabled, enabled); | public void setEnabled(boolean enabled) { boolean oldEnabled = super.isEnabled(); if (enabled != oldEnabled) { super.setEnabled(enabled); firePropertyChange(ENABLED_CHANGED_PROPERTY, oldEnabled, (boolean) enabled); } } |
firePropertyChange(MAXIMUM_ROW_COUNT_CHANGED_PROPERTY, | firePropertyChange("maximumRowCount", | public void setMaximumRowCount(int rowCount) { if (maximumRowCount != rowCount) { int oldMaximumRowCount = maximumRowCount; maximumRowCount = rowCount; firePropertyChange(MAXIMUM_ROW_COUNT_CHANGED_PROPERTY, oldMaximumRowCount, maximumRowCount); } } |
firePropertyChange(MODEL_CHANGED_PROPERTY, oldDataModel, dataModel); | firePropertyChange("model", oldDataModel, dataModel); | public void setModel(ComboBoxModel newDataModel) { // dataModel is null if it this method is called from inside the constructors. if(dataModel != null) { // Prevents unneccessary updates. if (dataModel == newDataModel) return; // Removes itself (as DataListener) from the to-be-replaced model. dataModel.removeListDataListener(this); } /* Adds itself as a DataListener to the new model. * It is intentioned that this operation will fail with a NullPointerException if the * caller delivered a null argument. */ newDataModel.addListDataListener(this); // Stores old data model for event notification. ComboBoxModel oldDataModel = dataModel; dataModel = newDataModel; // Notifies the listeners of the model change. firePropertyChange(MODEL_CHANGED_PROPERTY, oldDataModel, dataModel); } |
firePropertyChange(RENDERER_CHANGED_PROPERTY, oldRenderer, | firePropertyChange("renderer", oldRenderer, | public void setRenderer(ListCellRenderer aRenderer) { if (renderer != aRenderer) { ListCellRenderer oldRenderer = renderer; renderer = aRenderer; firePropertyChange(RENDERER_CHANGED_PROPERTY, oldRenderer, renderer); } } |
Unsafe.debug(nr); Unsafe.debug(address); | public static Throwable systemException(int nr, int address) throws PragmaUninterruptible, PragmaLoadStatics, PragmaPrivilegedAction { //Unsafe.getCurrentProcessor().getArchitecture().getStackReader().debugStackTrace(); //Unsafe.die(); Unsafe.debug(nr); Unsafe.debug(address); final String hexAddress = NumberUtils.hex(address, 8); final String state = " (" + Unsafe.getCurrentProcessor().getCurrentThread().getReadableErrorState() + ")"; switch (nr) { case EX_NULLPOINTER : return new NullPointerException("NPE at address " + hexAddress + state); case EX_PAGEFAULT : return new InternalError("Page fault at " + hexAddress + state); case EX_INDEXOUTOFBOUNDS : return new ArrayIndexOutOfBoundsException("Out of bounds at index " + address + state); case EX_DIV0 : return new ArithmeticException("Division by zero at address " + hexAddress + state); case EX_ABSTRACTMETHOD : return new AbstractMethodError("Abstract method at " + hexAddress + state); case EX_STACKOVERFLOW : return new StackOverflowError(); case EX_CLASSCAST : return new ClassCastException(); default : return new UnknownError("Unknown system-exception at " + hexAddress + state); } } |
|
final String state = " (" + Unsafe.getCurrentProcessor().getCurrentThread().getReadableErrorState() + ")"; | final VmThread current = Unsafe.getCurrentProcessor().getCurrentThread(); final String state = " (" + current.getReadableErrorState() + ")"; current.setInSystemException(); | public static Throwable systemException(int nr, int address) throws PragmaUninterruptible, PragmaLoadStatics, PragmaPrivilegedAction { //Unsafe.getCurrentProcessor().getArchitecture().getStackReader().debugStackTrace(); //Unsafe.die(); Unsafe.debug(nr); Unsafe.debug(address); final String hexAddress = NumberUtils.hex(address, 8); final String state = " (" + Unsafe.getCurrentProcessor().getCurrentThread().getReadableErrorState() + ")"; switch (nr) { case EX_NULLPOINTER : return new NullPointerException("NPE at address " + hexAddress + state); case EX_PAGEFAULT : return new InternalError("Page fault at " + hexAddress + state); case EX_INDEXOUTOFBOUNDS : return new ArrayIndexOutOfBoundsException("Out of bounds at index " + address + state); case EX_DIV0 : return new ArithmeticException("Division by zero at address " + hexAddress + state); case EX_ABSTRACTMETHOD : return new AbstractMethodError("Abstract method at " + hexAddress + state); case EX_STACKOVERFLOW : return new StackOverflowError(); case EX_CLASSCAST : return new ClassCastException(); default : return new UnknownError("Unknown system-exception at " + hexAddress + state); } } |
if (sm != null) { | if (sm != null) | private static final void checkPermission() { SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(new ReflectPermission("suppressAccessChecks")); } } |
} | private static final void checkPermission() { SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(new ReflectPermission("suppressAccessChecks")); } } |
|
protected void resolve() throws PluginException { final ExtensionPointModel ep = (ExtensionPointModel) getDeclaringPluginDescriptor().getPluginRegistry().getExtensionPoint(point); | protected void resolve(PluginRegistryModel registry) throws PluginException { final ExtensionPointModel ep = (ExtensionPointModel) registry.getExtensionPoint(point); | protected void resolve() throws PluginException { final ExtensionPointModel ep = (ExtensionPointModel) getDeclaringPluginDescriptor().getPluginRegistry().getExtensionPoint(point); if (ep == null) { throw new PluginException("Unknown extension-point " + point); } else { ep.add(this); } } |
protected void unresolve() throws PluginException { final ExtensionPointModel ep = (ExtensionPointModel) getDeclaringPluginDescriptor().getPluginRegistry().getExtensionPoint(point); | protected void unresolve(PluginRegistryModel registry) throws PluginException { final ExtensionPointModel ep = (ExtensionPointModel) registry.getExtensionPoint(point); | protected void unresolve() throws PluginException { final ExtensionPointModel ep = (ExtensionPointModel) getDeclaringPluginDescriptor().getPluginRegistry().getExtensionPoint(point); if (ep == null) { throw new PluginException("Unknown extension-point " + point); } else { ep.remove(this); } } |
helper.writeGetStaticsEntry(curInstrLabel, resultr, (VmIsolatedStaticsEntry)sf); | final GPR tmp = (GPR) L1AHelper.requestRegister(eContext, JvmType.REFERENCE, false); helper.writeGetStaticsEntry(curInstrLabel, resultr, (VmIsolatedStaticsEntry) sf, tmp); L1AHelper.releaseRegister(eContext, tmp); | public final void visit_getstatic(VmConstFieldRef fieldRef) { fieldRef.resolve(loader); final int type = JvmType.SignatureToType(fieldRef.getSignature()); final VmStaticField sf = (VmStaticField) fieldRef.getResolvedVmField(); // Initialize if needed if (!sf.getDeclaringClass().isInitialized()) { final X86RegisterPool pool = eContext.getGPRPool(); final GPR tmp = (GPR) L1AHelper.requestRegister(eContext, JvmType.INT, false); writeInitializeClass(fieldRef, tmp); pool.release(tmp); } // Get static field object if (JvmType.isFloat(type)) { final boolean is32bit = !fieldRef.isWide(); if (sf.isShared()) { helper.writeGetStaticsEntryToFPU(curInstrLabel, (VmSharedStaticsEntry)sf, is32bit); } else { final GPR tmp = (GPR) L1AHelper.requestRegister(eContext, JvmType.REFERENCE, false); helper.writeGetStaticsEntryToFPU(curInstrLabel, (VmIsolatedStaticsEntry) sf, is32bit, tmp); L1AHelper.releaseRegister(eContext, tmp); } final Item result = ifac.createFPUStack(type); vstack.fpuStack.push(result); vstack.push(result); } else if (!fieldRef.isWide()) { final WordItem result = L1AHelper.requestWordRegister(eContext, type, false); final GPR resultr = result.getRegister(); if (os.isCode32() || (type != JvmType.REFERENCE)) { if (sf.isShared()) { helper.writeGetStaticsEntry(curInstrLabel, resultr, (VmSharedStaticsEntry)sf); } else { helper.writeGetStaticsEntry(curInstrLabel, resultr, (VmIsolatedStaticsEntry)sf); } } else { if (sf.isShared()) { helper.writeGetStaticsEntry64(curInstrLabel, (GPR64)resultr, (VmSharedStaticsEntry)sf); } else { helper.writeGetStaticsEntry64(curInstrLabel, (GPR64)resultr, (VmIsolatedStaticsEntry)sf); } } vstack.push(result); } else { final DoubleWordItem result = L1AHelper.requestDoubleWordRegisters( eContext, type); if (os.isCode32()) { final GPR lsb = result.getLsbRegister(eContext); final GPR msb = result.getMsbRegister(eContext); if (sf.isShared()) { helper.writeGetStaticsEntry64(curInstrLabel, lsb, msb, (VmSharedStaticsEntry)sf); } else { helper.writeGetStaticsEntry64(curInstrLabel, lsb, msb, (VmIsolatedStaticsEntry)sf); } } else { final GPR64 reg = result.getRegister(eContext); if (sf.isShared()) { helper.writeGetStaticsEntry64(curInstrLabel, reg, (VmSharedStaticsEntry)sf); } else { helper.writeGetStaticsEntry64(curInstrLabel, reg, (VmIsolatedStaticsEntry)sf); } } vstack.push(result); } } |
lock(position, size, shared, true); | lock(position, size, shared, false); | public FileLock tryLock (long position, long size, boolean shared) throws IOException { if (position < 0 || size < 0) throw new IllegalArgumentException (); if (!isOpen ()) throw new ClosedChannelException (); if (shared && (mode & READ) == 0) throw new NonReadableChannelException (); if (!shared && (mode & WRITE) == 0) throw new NonWritableChannelException (); boolean completed = false; try { begin(); lock(position, size, shared, true); completed = true; return new FileLockImpl(this, position, size, shared); } finally { end(completed); } } |
writeOut(outputstream, "<for axisIdRef=\""+axis.getAxisId()+"\">"); | writeOut(outputstream, "<for axisIdRef=\""); writeOutAttribute(outputstream, axis.getAxisId()); writeOut(outputstream, "\">"); | protected void specificIOStyleToXDF( OutputStream outputstream,String indent) { ArrayList axisIds = new ArrayList (); int numberOfAxes = 0; synchronized (parentArray) { List axisList = parentArray.getAxisList(); Iterator iter = axisList.iterator(); while(iter.hasNext()) { AxisInterface axis = (AxisInterface) iter.next(); if (Specification.getInstance().isPrettyXDFOutput()) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); indent = indent + Specification.getInstance().getPrettyXDFOutputIndentation(); } writeOut(outputstream, "<for axisIdRef=\""+axis.getAxisId()+"\">"); numberOfAxes++; } } //write out nodes in formatCommandList synchronized (formatCommandList) { int stop = formatCommandList.size(); for (int i = 0; i <stop; i++) { if (Specification.getInstance().isPrettyXDFOutput()) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } ((XMLDataIOStyle) formatCommandList.get(i)).specificIOStyleToXDF(outputstream, indent); } } // end formatCommandList sync // print out remaining for statements while(numberOfAxes-- > 0) { if (Specification.getInstance().isPrettyXDFOutput()) { writeOut(outputstream, Constants.NEW_LINE); // peel off some indent indent = indent.substring(0,indent.length() - Specification.getInstance().getPrettyXDFOutputIndentation().length()); writeOut(outputstream, indent); } writeOut(outputstream, "</for>"); } } |
CurrentArray.getDataCube().setEndByte(null); } | public Object action (SaxDocumentHandler handler, Attributes attrs) throws SAXException { // we only need to do these things for the first time we enter // a data node if (DataNodeLevel == 0) { // A little 'pre-handling' as href is a specialattribute // that will hold an (Href) object rather than string value Entity hrefObj = null; String hrefValue = getAttributesValueByName(attrs,"href"); if (hrefValue != null ) { // now we look up the href from the entity list gathered by // the parser and transfer relevant info to our Href object hrefObj = new Entity(); Hashtable hrefInfo = (Hashtable) UnParsedEntity.get(hrefValue);/*Log.errorln("Href Entity has following keys:");java.util.Set keys = hrefInfo.keySet();Iterator iter = keys.iterator();while (iter.hasNext()) { Log.errorln(" Key:"+iter.next().toString());}*/ if (UnParsedEntity.containsKey(hrefValue)) { hrefObj.setName((String) hrefInfo.get("name"));/* if (hrefInfo.containsKey("base")) hrefObj.setBase((String) hrefInfo.get("base"));*/ if (hrefInfo.containsKey("systemId")) hrefObj.setSystemId((String) hrefInfo.get("systemId")); if (hrefInfo.containsKey("publicId")) hrefObj.setPublicId((String) hrefInfo.get("publicId")); if (hrefInfo.containsKey("ndata")) hrefObj.setNdata((String) hrefInfo.get("ndata")); } else { // bizarre. It usually means that the unparsed entity handler // isnt working like it should Log.error("Error: UnParsedEntity list lacks entry for :"+hrefValue); Log.errorln(" ignoring request to read data."); } } // update the array dataCube with passed attributes CurrentArray.getDataCube().setAttributes(attrs); // Clean up. We override the string value of Href and set it as // the Href object , if we created it (yeh, sloppy). if (hrefObj != null) CurrentArray.getDataCube().setHref(hrefObj); // determine the size of the dataFormat (s) in our dataCube if (CurrentArray.hasFieldAxis()) { // if there is a field axis, then its set to the number of fields FieldAxis fieldAxis = CurrentArray.getFieldAxis(); MaxDataFormatIndex = (fieldAxis.getLength()-1); } else { // its homogeneous MaxDataFormatIndex = 0; } // reset to start of which dataformat type we currently are reading CurrentDataFormatIndex = 0; // reset to start of which IOCmd we currently are reading CurrentIOCmdIndex = 0; // reset the list of dataformats we are reading DataFormatList = CurrentArray.getDataFormatList(); NrofDataFormats = DataFormatList.length; IntRadix = new int [NrofDataFormats]; // CALCULATE CURRENTREADBYTES // set up some other global information bout the dataformats // that will help speed reading CurrentReadBytes = 0; for (int i=0; i < NrofDataFormats; i++) { CurrentReadBytes += DataFormatList[i].numOfBytes(); if (DataFormatList[i] instanceof IntegerDataFormat) { String type = ((IntegerDataFormat) DataFormatList[i]).getType(); if (type.equals(Constants.INTEGER_TYPE_DECIMAL)) IntRadix[i] = 10; else if (type.equals(Constants.INTEGER_TYPE_HEX)) IntRadix[i] = 16; else if (type.equals(Constants.INTEGER_TYPE_OCTAL)) IntRadix[i] = 8; else IntRadix[i] = 10; // default } else if (DataFormatList[i] instanceof BinaryIntegerDataFormat) { IntRadix[i] = 10; } } // DONT FORGET TO ADD IN THE SKIPCHAR bytes XMLDataIOStyle readObj = CurrentArray.getXMLDataIOStyle(); if (readObj instanceof FormattedXMLDataIOStyle) { Iterator citer = ((FormattedXMLDataIOStyle) readObj).getFormatCommands().iterator(); while (citer.hasNext()) { FormattedIOCmd currentIOCmd = (FormattedIOCmd) citer.next(); if (currentIOCmd instanceof SkipCharFormattedIOCmd) { Integer bytes_to_skip = ((SkipCharFormattedIOCmd) currentIOCmd).getCount(); CurrentReadBytes += bytes_to_skip.intValue(); } } } // else if (readObj instanceof DelimitedXMLDataIOStyle) // {// throw new SAXException("Cant parse delimited data from an external file (yet).");// } if (CurrentReadBytes > MAXINPUTREADSIZE) { Log.errorln("This XDF file has single record that is too big (greater than "+MAXINPUTREADSIZE+" bytes in a record) to parse by this code"); System.exit(-1); } // now determine properread size CurrentInputReadSize = BASEINPUTREADSIZE * CurrentReadBytes; // make sure its not TOO big while (CurrentInputReadSize > MAXINPUTREADSIZE) { CurrentInputReadSize -= CurrentReadBytes; } } XMLDataIOStyle readObj = CurrentArray.getXMLDataIOStyle();// FastestAxis = (AxisInterface) CurrentArray.getAxes().get(0);// LastFastAxisCoordinate = 0; LastFieldAxisCoordinate = 0; if ( readObj instanceof TaggedXMLDataIOStyle) { // is this needed? if (DataNodeLevel == 0) TaggedLocatorObj = CurrentArray.createLocator(); } else { // A safety. We clear datablock when this is the first datanode we // have entered DATABLOCK is used in cases where we read in untagged data if (DataNodeLevel == 0) DATABLOCK = new StringBuffer (); } // entered a datanode, raise the count // this (partially helps) declare we are now reading data, DataNodeLevel++; // Ok, we actually may need to read data immediately here. // This happens when the data node specifies that data lies in an external file // (viz the href entity mechanism) Entity href = CurrentArray.getDataCube().getHref(); if (href != null) { int startByte = CurrentArray.getDataCube().getStartByte().intValue(); int endByte = -1; // default: -1 means read it all if (CurrentArray.getDataCube().getEndByte() != null) endByte = CurrentArray.getDataCube().getEndByte().intValue(); // The first method is the 'old' way. // If you uncomment it be sure to uncomment line that looks like: // if (CurrentArray.getDataCube().getHref() != null) return; // in the end dataElementHandler // DATABLOCK.append(getHrefData(href, CurrentArray.getDataCube().getCompression())); loadHrefDataIntoCurrentArray(href, readObj, CurrentArray.getDataCube().getCompression(), startByte, endByte); } return readObj; } |
|
} | public int columnAtPoint(Point point) { int x0 = getLocation().x; int ncols = getColumnCount(); Dimension gap = getIntercellSpacing(); TableColumnModel cols = getColumnModel(); int x = point.x; for (int i = 0; i < ncols; ++i) { int width = cols.getColumn(i).getWidth() + (gap == null ? 0 : gap.width); if (0 <= x && x < width) return i; x -= width; } return -1; } |
|
if (rowBeingEdited > -1 && columnBeingEdited > -1) { if (getValueAt(rowBeingEdited, columnBeingEdited) instanceof JTextField) { remove ((Component)getValueAt(rowBeingEdited, columnBeingEdited)); setValueAt(oldCellValue, rowBeingEdited, columnBeingEdited); } rowBeingEdited = -1; columnBeingEdited = -1; } editorTimer.stop(); editorComp = null; cellEditor = null; requestFocusInWindow(false); | public void editingCanceled (ChangeEvent event) { repaint(); } |
|
if (rowBeingEdited > -1 && columnBeingEdited > -1) { if (getValueAt(rowBeingEdited, columnBeingEdited) instanceof JTextField) { remove((Component)getValueAt(rowBeingEdited, columnBeingEdited)); setValueAt(((JTextField)editorComp).getText(), rowBeingEdited, columnBeingEdited); } rowBeingEdited = -1; columnBeingEdited = -1; } editorTimer.stop(); editorComp = null; cellEditor = null; requestFocusInWindow(false); | public void editingStopped (ChangeEvent event) { repaint(); } |
|
} | public int rowAtPoint(Point point) { int y0 = getLocation().y; int nrows = getRowCount(); Dimension gap = getIntercellSpacing(); int height = getRowHeight() + (gap == null ? 0 : gap.height); int y = point.y; for (int i = 0; i < nrows; ++i) { if (0 <= y && y < height) return i; y -= height; } return -1; } |
|
if (rowHeight < 1) | if (r < 1) | public void setRowHeight(int r) { if (rowHeight < 1) throw new IllegalArgumentException(); rowHeight = r; revalidate(); repaint(); } |
if (!isCellEditable(row, column)) return; if (value instanceof Component) add((Component)value); | public void setValueAt(Object value, int row, int column) { dataModel.setValueAt(value, row, convertColumnIndexToModel(column)); } |
|
private void closeDialog() | void closeDialog() | private void closeDialog() { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).dispose(); } |
private void filterEntries() | void filterEntries() | private void filterEntries() { FileFilter[] list = filechooser.getChoosableFileFilters(); if (filters.getItemCount() > 0) filters.removeAllItems(); int index = -1; String selected = filechooser.getFileFilter().getDescription(); for (int i = 0; i < list.length; i++) { if (selected.equals(list[i].getDescription())) index = i; filters.addItem(list[i].getDescription()); } filters.setSelectedIndex(index); filters.revalidate(); filters.repaint(); } |
AttributeSet atts = data[0].getAttributes(); | AttributeSet atts = child.getAttributes(); | private void createFracture(ElementSpec[] data) { BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element child = paragraph.getElement(index); Edit edit = getEditForParagraphAndIndex(paragraph, index); AttributeSet atts = data[0].getAttributes(); if (offset != 0) { Element newEl1 = createLeafElement(paragraph, atts, child.getStartOffset(), offset); edit.addAddedElement(newEl1); edit.addRemovedElement(child); } } |
int index = paragraph.getElementIndex(offset); | int index = paragraph.getElementIndex(pos); | private void insertFirstContentTag(ElementSpec[] data) { ElementSpec first = data[0]; BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element current = paragraph.getElement(index); int newEndOffset = offset + first.length; boolean onlyContent = data.length == 1; Edit edit = getEditForParagraphAndIndex(paragraph, index); switch (first.getDirection()) { case ElementSpec.JoinPreviousDirection: if (current.getEndOffset() != newEndOffset && !onlyContent) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), newEndOffset); edit.addAddedElement(newEl1); edit.addRemovedElement(current); offset = newEndOffset; } break; case ElementSpec.JoinNextDirection: if (offset != 0) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); edit.addAddedElement(newEl1); Element next = paragraph.getElement(index + 1); if (onlyContent) newEl1 = createLeafElement(paragraph, next.getAttributes(), offset, next.getEndOffset()); else { newEl1 = createLeafElement(paragraph, next.getAttributes(), offset, newEndOffset); offset = newEndOffset; } edit.addAddedElement(newEl1); edit.addRemovedElement(current); edit.addRemovedElement(next); } break; default: if (current.getStartOffset() != offset) { Element newEl = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); edit.addAddedElement(newEl); } edit.addRemovedElement(current); Element newEl1 = createLeafElement(paragraph, first.getAttributes(), offset, newEndOffset); edit.addAddedElement(newEl1); if (current.getEndOffset() != endOffset) recreateLeaves(newEndOffset, paragraph, onlyContent); else offset = newEndOffset; break; } } |
int newEndOffset = offset + first.length; | int newEndOffset = pos + first.length; | private void insertFirstContentTag(ElementSpec[] data) { ElementSpec first = data[0]; BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element current = paragraph.getElement(index); int newEndOffset = offset + first.length; boolean onlyContent = data.length == 1; Edit edit = getEditForParagraphAndIndex(paragraph, index); switch (first.getDirection()) { case ElementSpec.JoinPreviousDirection: if (current.getEndOffset() != newEndOffset && !onlyContent) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), newEndOffset); edit.addAddedElement(newEl1); edit.addRemovedElement(current); offset = newEndOffset; } break; case ElementSpec.JoinNextDirection: if (offset != 0) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); edit.addAddedElement(newEl1); Element next = paragraph.getElement(index + 1); if (onlyContent) newEl1 = createLeafElement(paragraph, next.getAttributes(), offset, next.getEndOffset()); else { newEl1 = createLeafElement(paragraph, next.getAttributes(), offset, newEndOffset); offset = newEndOffset; } edit.addAddedElement(newEl1); edit.addRemovedElement(current); edit.addRemovedElement(next); } break; default: if (current.getStartOffset() != offset) { Element newEl = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); edit.addAddedElement(newEl); } edit.addRemovedElement(current); Element newEl1 = createLeafElement(paragraph, first.getAttributes(), offset, newEndOffset); edit.addAddedElement(newEl1); if (current.getEndOffset() != endOffset) recreateLeaves(newEndOffset, paragraph, onlyContent); else offset = newEndOffset; break; } } |
if (offset != 0) | if (pos != 0) | private void insertFirstContentTag(ElementSpec[] data) { ElementSpec first = data[0]; BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element current = paragraph.getElement(index); int newEndOffset = offset + first.length; boolean onlyContent = data.length == 1; Edit edit = getEditForParagraphAndIndex(paragraph, index); switch (first.getDirection()) { case ElementSpec.JoinPreviousDirection: if (current.getEndOffset() != newEndOffset && !onlyContent) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), newEndOffset); edit.addAddedElement(newEl1); edit.addRemovedElement(current); offset = newEndOffset; } break; case ElementSpec.JoinNextDirection: if (offset != 0) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); edit.addAddedElement(newEl1); Element next = paragraph.getElement(index + 1); if (onlyContent) newEl1 = createLeafElement(paragraph, next.getAttributes(), offset, next.getEndOffset()); else { newEl1 = createLeafElement(paragraph, next.getAttributes(), offset, newEndOffset); offset = newEndOffset; } edit.addAddedElement(newEl1); edit.addRemovedElement(current); edit.addRemovedElement(next); } break; default: if (current.getStartOffset() != offset) { Element newEl = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); edit.addAddedElement(newEl); } edit.addRemovedElement(current); Element newEl1 = createLeafElement(paragraph, first.getAttributes(), offset, newEndOffset); edit.addAddedElement(newEl1); if (current.getEndOffset() != endOffset) recreateLeaves(newEndOffset, paragraph, onlyContent); else offset = newEndOffset; break; } } |
offset); | pos); | private void insertFirstContentTag(ElementSpec[] data) { ElementSpec first = data[0]; BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element current = paragraph.getElement(index); int newEndOffset = offset + first.length; boolean onlyContent = data.length == 1; Edit edit = getEditForParagraphAndIndex(paragraph, index); switch (first.getDirection()) { case ElementSpec.JoinPreviousDirection: if (current.getEndOffset() != newEndOffset && !onlyContent) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), newEndOffset); edit.addAddedElement(newEl1); edit.addRemovedElement(current); offset = newEndOffset; } break; case ElementSpec.JoinNextDirection: if (offset != 0) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); edit.addAddedElement(newEl1); Element next = paragraph.getElement(index + 1); if (onlyContent) newEl1 = createLeafElement(paragraph, next.getAttributes(), offset, next.getEndOffset()); else { newEl1 = createLeafElement(paragraph, next.getAttributes(), offset, newEndOffset); offset = newEndOffset; } edit.addAddedElement(newEl1); edit.addRemovedElement(current); edit.addRemovedElement(next); } break; default: if (current.getStartOffset() != offset) { Element newEl = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); edit.addAddedElement(newEl); } edit.addRemovedElement(current); Element newEl1 = createLeafElement(paragraph, first.getAttributes(), offset, newEndOffset); edit.addAddedElement(newEl1); if (current.getEndOffset() != endOffset) recreateLeaves(newEndOffset, paragraph, onlyContent); else offset = newEndOffset; break; } } |
offset, next.getEndOffset()); | pos, next.getEndOffset()); | private void insertFirstContentTag(ElementSpec[] data) { ElementSpec first = data[0]; BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element current = paragraph.getElement(index); int newEndOffset = offset + first.length; boolean onlyContent = data.length == 1; Edit edit = getEditForParagraphAndIndex(paragraph, index); switch (first.getDirection()) { case ElementSpec.JoinPreviousDirection: if (current.getEndOffset() != newEndOffset && !onlyContent) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), newEndOffset); edit.addAddedElement(newEl1); edit.addRemovedElement(current); offset = newEndOffset; } break; case ElementSpec.JoinNextDirection: if (offset != 0) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); edit.addAddedElement(newEl1); Element next = paragraph.getElement(index + 1); if (onlyContent) newEl1 = createLeafElement(paragraph, next.getAttributes(), offset, next.getEndOffset()); else { newEl1 = createLeafElement(paragraph, next.getAttributes(), offset, newEndOffset); offset = newEndOffset; } edit.addAddedElement(newEl1); edit.addRemovedElement(current); edit.addRemovedElement(next); } break; default: if (current.getStartOffset() != offset) { Element newEl = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); edit.addAddedElement(newEl); } edit.addRemovedElement(current); Element newEl1 = createLeafElement(paragraph, first.getAttributes(), offset, newEndOffset); edit.addAddedElement(newEl1); if (current.getEndOffset() != endOffset) recreateLeaves(newEndOffset, paragraph, onlyContent); else offset = newEndOffset; break; } } |
offset, newEndOffset); offset = newEndOffset; | pos, newEndOffset); pos = newEndOffset; | private void insertFirstContentTag(ElementSpec[] data) { ElementSpec first = data[0]; BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element current = paragraph.getElement(index); int newEndOffset = offset + first.length; boolean onlyContent = data.length == 1; Edit edit = getEditForParagraphAndIndex(paragraph, index); switch (first.getDirection()) { case ElementSpec.JoinPreviousDirection: if (current.getEndOffset() != newEndOffset && !onlyContent) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), newEndOffset); edit.addAddedElement(newEl1); edit.addRemovedElement(current); offset = newEndOffset; } break; case ElementSpec.JoinNextDirection: if (offset != 0) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); edit.addAddedElement(newEl1); Element next = paragraph.getElement(index + 1); if (onlyContent) newEl1 = createLeafElement(paragraph, next.getAttributes(), offset, next.getEndOffset()); else { newEl1 = createLeafElement(paragraph, next.getAttributes(), offset, newEndOffset); offset = newEndOffset; } edit.addAddedElement(newEl1); edit.addRemovedElement(current); edit.addRemovedElement(next); } break; default: if (current.getStartOffset() != offset) { Element newEl = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); edit.addAddedElement(newEl); } edit.addRemovedElement(current); Element newEl1 = createLeafElement(paragraph, first.getAttributes(), offset, newEndOffset); edit.addAddedElement(newEl1); if (current.getEndOffset() != endOffset) recreateLeaves(newEndOffset, paragraph, onlyContent); else offset = newEndOffset; break; } } |
if (current.getStartOffset() != offset) | if (current.getStartOffset() != pos) | private void insertFirstContentTag(ElementSpec[] data) { ElementSpec first = data[0]; BranchElement paragraph = (BranchElement) elementStack.peek(); int index = paragraph.getElementIndex(offset); Element current = paragraph.getElement(index); int newEndOffset = offset + first.length; boolean onlyContent = data.length == 1; Edit edit = getEditForParagraphAndIndex(paragraph, index); switch (first.getDirection()) { case ElementSpec.JoinPreviousDirection: if (current.getEndOffset() != newEndOffset && !onlyContent) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), newEndOffset); edit.addAddedElement(newEl1); edit.addRemovedElement(current); offset = newEndOffset; } break; case ElementSpec.JoinNextDirection: if (offset != 0) { Element newEl1 = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); edit.addAddedElement(newEl1); Element next = paragraph.getElement(index + 1); if (onlyContent) newEl1 = createLeafElement(paragraph, next.getAttributes(), offset, next.getEndOffset()); else { newEl1 = createLeafElement(paragraph, next.getAttributes(), offset, newEndOffset); offset = newEndOffset; } edit.addAddedElement(newEl1); edit.addRemovedElement(current); edit.addRemovedElement(next); } break; default: if (current.getStartOffset() != offset) { Element newEl = createLeafElement(paragraph, current.getAttributes(), current.getStartOffset(), offset); edit.addAddedElement(newEl); } edit.addRemovedElement(current); Element newEl1 = createLeafElement(paragraph, first.getAttributes(), offset, newEndOffset); edit.addAddedElement(newEl1); if (current.getEndOffset() != endOffset) recreateLeaves(newEndOffset, paragraph, onlyContent); else offset = newEndOffset; break; } } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.