bugged
stringlengths
6
599k
fixed
stringlengths
10
599k
__index_level_0__
int64
0
1.13M
public static void notmain(String[] args) throws Exception { if(DEBUG) verbose = true; parseArgs(args); printlnVerbose("Processing: " + dmgFile); RandomAccessFile dmgRaf = new RandomAccessFile(dmgFile, "r"); RandomAccessFile isoRaf = null; boolean testOnly = false; if(isoFile != null) { isoRaf = new RandomAccessFile(isoFile, "rw"); isoRaf.setLength(0); printlnVerbose("Extracting to: " + isoFile); } else { testOnly = true; printlnVerbose("Simulating extraction..."); } dmgRaf.seek(dmgRaf.length()-PLIST_ADDRESS_1); long plistBegin1 = dmgRaf.readLong(); long plistEnd = dmgRaf.readLong(); dmgRaf.seek(dmgRaf.length()-PLIST_ADDRESS_2); long plistBegin2 = dmgRaf.readLong(); long plistSize = dmgRaf.readLong(); if(DEBUG) { println("Read addresses:", " " + plistBegin1, " " + plistBegin2); } if(plistBegin1 != plistBegin2) { println("Addresses not equal! Assumption broken... =/", plistBegin1 + " != " + plistBegin2); System.exit(0); } if(plistSize != (plistEnd-plistBegin1)) { println("plistSize field does not match plistEnd marker!", "plistSize=" + plistSize + " plistBegin1=" + plistBegin1 + " plistEnd=" + plistEnd + " plistEnd-plistBegin1=" + (plistEnd-plistBegin1)); } printlnVerbose("Jumping to address..."); dmgRaf.seek(plistBegin1); byte[] buffer = new byte[(int)plistSize]; dmgRaf.read(buffer); InputStream is = new ByteArrayInputStream(buffer); NodeBuilder handler = new NodeBuilder(); SAXParser saxParser = SAXParserFactory.newInstance().newSAXParser(); try {// System.out.println("validation: " + saxParser.getProperty("validation"));// System.out.println("external-general-entities: " + saxParser.getProperty("external-general-entities"));// System.out.println("external-parameter-entities: " + saxParser.getProperty("external-parameter-entities"));// System.out.println("is-standalone: " + saxParser.getProperty("is-standalone"));// System.out.println("lexical-handler: " + saxParser.getProperty("lexical-handler"));// System.out.println("parameter-entities: " + saxParser.getProperty("parameter-entities"));// System.out.println("namespaces: " + saxParser.getProperty("namespaces"));// System.out.println("namespace-prefixes: " + saxParser.getProperty("namespace-prefixes"));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty("")); //System.out.println("isValidating: " + saxParser.isValidating()); saxParser.parse(is, handler); } catch(SAXException se) { se.printStackTrace(); System.err.println("Could not read the partition list... exiting."); System.exit(1); } XMLNode[] rootNodes = handler.getRoots(); if(rootNodes.length != 1) { println("Could not parse DMG-file!"); System.exit(0); } /* Ok, now we have a tree built from the XML-document. Let's walk to the right place. */ /* cd plist cd dict cdkey resource-fork (type:dict) cdkey blkx (type:array) */ XMLNode current; XMLElement[] children; boolean keyFound; current = rootNodes[0]; //We are at plist... probably (there should be only one root node) current = current.cd("dict"); current = current.cdkey("resource-fork"); current = current.cdkey("blkx"); printlnVerbose("Found " + current.getChildren().length + " partitions:"); byte[] inBuffer = new byte[0x40000]; byte[] outBuffer = new byte[0x40000]; byte[] zeroblock = new byte[4096]; /* I think java always zeroes its arrays on creation... but let's play safe. */ for(int y = 0; y < zeroblock.length; ++y) zeroblock[y] = 0; LinkedList<DMGBlock> blocks = new LinkedList<DMGBlock>(); long elementNumber = 0; //long lastOffs = 0; long lastOutOffset = 0; long lastInOffset = 0; long totalSize = 0; int errorsReported = 0; int warningsReported = 0; reportProgress(0); for(XMLElement xe : current.getChildren()) { if(progmon != null && progmon.isCanceled()) System.exit(0); if(xe instanceof XMLNode) { XMLNode xn = (XMLNode)xe; byte[] data = Base64.decode(xn.getKeyValue("Data")); long partitionSize = calculatePartitionSize(data); totalSize += partitionSize; printlnVerbose(" " + xn.getKeyValue("Name")); printlnVerbose(" ID: " + xn.getKeyValue("ID")); printlnVerbose(" Attributes: " + xn.getKeyValue("Attributes")); printlnVerbose(" Partition map data length: " + data.length + " bytes"); printlnVerbose(" Partition size: " + partitionSize + " bytes"); if(verbose) { printlnVerbose(" Dumping blkx..."); FileOutputStream fos = new FileOutputStream(xn.getKeyValue("ID") + ".blkx"); fos.write(data); fos.close(); } if(DEBUG) { File dumpFile = new File("data " + xn.getKeyValue("ID") + ".bin"); println(" Dumping partition map to file: " + dumpFile); FileOutputStream dump = new FileOutputStream(dumpFile); dump.write(data); dump.close(); } int offset = 0xCC; int blockType = 0; /* Offset of the input data for the current block in the input file */ long inOffset = 0; /* Size of the input data for the current block */ long inSize = 0; /* Offset of the output data for the current block in the output file */ long outOffset = 0; /* Size of the output data (possibly larger than inSize because of decompression, zero expansion...) */ long outSize = 0; long lastByteReadInBlock = -1; boolean addInOffset = false; //, lastInOffs = 0; int blockCount = 0; while(blockType != BT_END) { if(progmon != null && progmon.isCanceled()) System.exit(0); DataInputStream dis = new DataInputStream(new ByteArrayInputStream(data)); int bytesSkipped = 0; while(bytesSkipped < offset) bytesSkipped += dis.skipBytes(offset-bytesSkipped); blockType = dis.readInt(); int skipped = dis.readInt(); //Skip 4 bytes forward outOffset = dis.readLong()*0x200;//(dis.readInt() & 0xffffffffL)*0x200; //unsigned int -> long //dis.readInt(); //Skip 4 bytes forward outSize = dis.readLong()*0x200;//(dis.readInt() & 0xffffffffL)*0x200; //unsigned int -> long inOffset = dis.readLong();// & 0xffffffffL; //unsigned int -> long //dis.readInt(); //Skip 4 bytes forward inSize = dis.readLong();//dis.readInt() & 0xffffffffL; //unsigned int -> long if(lastByteReadInBlock == -1) lastByteReadInBlock = inOffset; lastByteReadInBlock += inSize; /* The lines below are a "hack" that I had to do to make dmgx work with certain dmg-files. I don't understand the issue at all, which is why this hack is here, but sometimes inOffset == 0 means that it is 0 relative to the previous partition's last inOffset. And sometimes it doesn't (meaning the actual position 0 in the dmg file). */ if(addInOffset) { if(DEBUG) println("!-----addInOffset mode: inOffset tranformation " + inOffset + "->" + (inOffset+lastInOffset)); inOffset += lastInOffset; } else if(inOffset == 0) { if(DEBUG) println("!-----Detected inOffset == 0, setting to " + lastInOffset); addInOffset = true; inOffset = lastInOffset; } outOffset += lastOutOffset; DMGBlock currentBlock = new DMGBlock(blockType, skipped, outOffset, outSize, inOffset, inSize); blocks.add(currentBlock); if(DEBUG) { println("outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize + " lastOutOffset=" + lastOutOffset + " lastInOffset=" + lastInOffset /*+ " lastInOffs=" + lastInOffs + " lastOffs=" + lastOffs*/); } if(blockType == BT_ADC) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_ADC not supported."); ++errorsReported; if(!testOnly) System.exit(0); } else if(blockType == BT_ZLIB) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZLIB processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZLIB FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); try { DMGBlockHandlers.processZlibBlock(currentBlock, dmgRaf, isoRaf, testOnly, dummyMonitor); } catch(DataFormatException dfe) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_ZLIB Could not decode..."); ++errorsReported; if(!DEBUG) { println("outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize + " lastOutOffset=" + lastOutOffset + " lastInOffset=" + lastInOffset); } dfe.printStackTrace(); if(!testOnly) System.exit(0); else { println(" Testing mode, so continuing..."); //System.exit(0); break; } } } else if(blockType == BT_BZIP2) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_BZIP2 not currently supported."); ++errorsReported; if(!testOnly) System.exit(0); } else if(blockType == BT_COPY) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_COPY processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_COPY FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } dmgRaf.seek(/*lastOffs+*/inOffset); int bytesRead = dmgRaf.read(inBuffer, 0, Math.min((int)inSize, inBuffer.length)); long totalBytesRead = bytesRead; while(bytesRead != -1) { reportFilePointerProgress(dmgRaf); if(!testOnly) isoRaf.write(inBuffer, 0, bytesRead); if(totalBytesRead >= inSize) break; bytesRead = dmgRaf.read(inBuffer, 0, Math.min((int)(inSize-totalBytesRead), inBuffer.length)); if(bytesRead > 0) totalBytesRead += bytesRead; } //lastInOffs = inOffset+inSize; } else if(blockType == BT_ZERO) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZERO processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZERO FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } reportFilePointerProgress(dmgRaf); long numberOfZeroBlocks = outSize/zeroblock.length; int numberOfRemainingBytes = (int)(outSize%zeroblock.length); for(int j = 0; j < numberOfZeroBlocks; ++j) { if(!testOnly) isoRaf.write(zeroblock); } if(!testOnly) isoRaf.write(zeroblock, 0, numberOfRemainingBytes); //lastInOffs = inOffset+inSize; } else if(blockType == BT_ZERO2) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZERO2 processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZERO2 FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } reportFilePointerProgress(dmgRaf); long numberOfZeroBlocks = outSize/zeroblock.length; int numberOfRemainingBytes = (int)(outSize%zeroblock.length); for(int j = 0; j < numberOfZeroBlocks; ++j) { if(!testOnly) isoRaf.write(zeroblock); } if(!testOnly) isoRaf.write(zeroblock, 0, numberOfRemainingBytes); //lastInOffs = inOffset+inSize; } else if(blockType == BT_UNKNOWN) { /* I have no idea what this blocktype is... but it's common, and usually doesn't appear more than 2-3 times in a dmg. As long as its input and output sizes are 0, there's no reason to complain... is there? */ if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_UNKNOWN processing..."); if(!(inSize == 0 && outSize == 0)) { println(" " + elementNumber + ":" + blockCount + ". WARNING: Blocktype BT_UNKNOWN had non-zero sizes...", " inSize=" + inSize + ", outSize=" + outSize); ++warningsReported; //println(" The author of the program would be pleased if you contacted him about this."); // ...or would I? } } else if(blockType == BT_END) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_END processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_END FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); //lastOffs += lastInOffs; lastOutOffset = outOffset; lastInOffset += lastByteReadInBlock; } else { println(" " + elementNumber + ":" + blockCount + ". WARNING: previously unseen blocktype " + blockType + " [0x" + Integer.toHexString(blockType) + "]", " " + elementNumber + ":" + blockCount + ". outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize); ++warningsReported; if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". unknown blocktype FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); } offset += 0x28; ++blockCount; } } ++elementNumber; } //printlnVerbose("Progress: 100% Done!"); reportProgress(100); String summary = (errorsReported != 0)?errorsReported+" errors reported":"No errors reported"; summary += (warningsReported != 0)?" ("+warningsReported+" warnings emitted).":"."; if(!graphical) { newline(); println(summary); printlnVerbose("Total extracted bytes: " + totalSize + " B"); } else { progmon.close(); JOptionPane.showMessageDialog(null, "Extraction complete! " + summary + "\n" + "Total extracted bytes: " + totalSize + " B", "Information", JOptionPane.INFORMATION_MESSAGE); System.exit(0); } if(!DEBUG) { if(isoRaf != null) isoRaf.close(); dmgRaf.close(); } else { if(isoRaf != null) isoRaf.close();// System.out.println("blocks.size()=" + blocks.size());// for(DMGBlock b : blocks)// System.out.println(" " + b.toString()); LinkedList<DMGBlock> merged = mergeBlocks(blocks);// System.out.println("merged.size()=" + merged.size());// for(DMGBlock b : merged)// System.out.println(" " + b.toString()); println("Extracting all the parts not containing block data from source file:"); int i = 1; DMGBlock previous = null; for(DMGBlock b : merged) { if(previous == null && b.inOffset > 0) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(0); byte[] data = new byte[(int)(b.inOffset)]; dmgRaf.read(data); curFos.write(data); curFos.close(); } else if(previous != null) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(previous.inOffset+previous.inSize); byte[] data = new byte[(int)(b.inOffset-(previous.inOffset+previous.inSize))]; dmgRaf.read(data); curFos.write(data); curFos.close(); } previous = b; } if(previous.inOffset+previous.inSize != dmgRaf.length()) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(previous.inOffset+previous.inSize); byte[] data = new byte[(int)(dmgRaf.length()-(previous.inOffset+previous.inSize))]; dmgRaf.read(data); curFos.write(data); curFos.close(); } dmgRaf.close(); System.out.println("done!"); } }
public static void notmain(String[] args) throws Exception { if(DEBUG) verbose = true; parseArgs(args); printlnVerbose("Processing: " + dmgFile); RandomAccessFile dmgRaf = new RandomAccessFile(dmgFile, "r"); RandomAccessFile isoRaf = null; boolean testOnly = false; if(isoFile != null) { isoRaf = new RandomAccessFile(isoFile, "rw"); isoRaf.setLength(0); printlnVerbose("Extracting to: " + isoFile); } else { testOnly = true; printlnVerbose("Simulating extraction..."); } dmgRaf.seek(dmgRaf.length()-PLIST_ADDRESS_1); long plistBegin1 = dmgRaf.readLong(); long plistEnd = dmgRaf.readLong(); dmgRaf.seek(dmgRaf.length()-PLIST_ADDRESS_2); long plistBegin2 = dmgRaf.readLong(); long plistSize = dmgRaf.readLong(); if(DEBUG) { println("Read addresses:", " " + plistBegin1, " " + plistBegin2); } if(plistBegin1 != plistBegin2) { println("Addresses not equal! Assumption broken... =/", plistBegin1 + " != " + plistBegin2); System.exit(0); } if(plistSize != (plistEnd-plistBegin1)) { println("plistSize field does not match plistEnd marker!", "plistSize=" + plistSize + " plistBegin1=" + plistBegin1 + " plistEnd=" + plistEnd + " plistEnd-plistBegin1=" + (plistEnd-plistBegin1)); } printlnVerbose("Jumping to address..."); dmgRaf.seek(plistBegin1); byte[] buffer = new byte[(int)plistSize]; dmgRaf.read(buffer); InputStream is = new ByteArrayInputStream(buffer); NodeBuilder handler = new NodeBuilder(); SAXParser saxParser = SAXParserFactory.newInstance().newSAXParser(); try {// System.out.println("validation: " + saxParser.getProperty("validation"));// System.out.println("external-general-entities: " + saxParser.getProperty("external-general-entities"));// System.out.println("external-parameter-entities: " + saxParser.getProperty("external-parameter-entities"));// System.out.println("is-standalone: " + saxParser.getProperty("is-standalone"));// System.out.println("lexical-handler: " + saxParser.getProperty("lexical-handler"));// System.out.println("parameter-entities: " + saxParser.getProperty("parameter-entities"));// System.out.println("namespaces: " + saxParser.getProperty("namespaces"));// System.out.println("namespace-prefixes: " + saxParser.getProperty("namespace-prefixes"));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty("")); //System.out.println("isValidating: " + saxParser.isValidating()); saxParser.parse(is, handler); } catch(SAXException se) { se.printStackTrace(); System.err.println("Could not read the partition list... exiting."); System.exit(1); } XMLNode[] rootNodes = handler.getRoots(); if(rootNodes.length != 1) { println("Could not parse DMG-file!"); System.exit(0); } /* Ok, now we have a tree built from the XML-document. Let's walk to the right place. */ /* cd plist cd dict cdkey resource-fork (type:dict) cdkey blkx (type:array) */ XMLNode current; XMLElement[] children; boolean keyFound; current = rootNodes[0]; //We are at plist... probably (there should be only one root node) current = current.cd("dict"); current = current.cdkey("resource-fork"); current = current.cdkey("blkx"); printlnVerbose("Found " + current.getChildren().length + " partitions:"); byte[] inBuffer = new byte[0x40000]; byte[] outBuffer = new byte[0x40000]; byte[] zeroblock = new byte[4096]; /* I think java always zeroes its arrays on creation... but let's play safe. */ for(int y = 0; y < zeroblock.length; ++y) zeroblock[y] = 0; LinkedList<DMGBlock> blocks = new LinkedList<DMGBlock>(); long elementNumber = 0; //long lastOffs = 0; long lastOutOffset = 0; long lastInOffset = 0; long totalSize = 0; int errorsReported = 0; int warningsReported = 0; reportProgress(0); for(XMLElement xe : current.getChildren()) { if(progmon != null && progmon.isCanceled()) System.exit(0); if(xe instanceof XMLNode) { XMLNode xn = (XMLNode)xe; byte[] data = Base64.decode(xn.getKeyValue("Data")); long partitionSize = calculatePartitionSize(data); totalSize += partitionSize; printlnVerbose(" " + xn.getKeyValue("Name")); printlnVerbose(" ID: " + xn.getKeyValue("ID")); printlnVerbose(" Attributes: " + xn.getKeyValue("Attributes")); printlnVerbose(" Partition map data length: " + data.length + " bytes"); printlnVerbose(" Partition size: " + partitionSize + " bytes"); if(verbose) { printlnVerbose(" Dumping blkx..."); FileOutputStream fos = new FileOutputStream(xn.getKeyValue("ID") + ".blkx"); fos.write(data); fos.close(); } if(DEBUG) { File dumpFile = new File("data " + xn.getKeyValue("ID") + ".bin"); println(" Dumping partition map to file: " + dumpFile); FileOutputStream dump = new FileOutputStream(dumpFile); dump.write(data); dump.close(); } int offset = 0xCC; int blockType = 0; /* Offset of the input data for the current block in the input file */ long inOffset = 0; /* Size of the input data for the current block */ long inSize = 0; /* Offset of the output data for the current block in the output file */ long outOffset = 0; /* Size of the output data (possibly larger than inSize because of decompression, zero expansion...) */ long outSize = 0; long lastByteReadInBlock = -1; boolean addInOffset = false; //, lastInOffs = 0; int blockCount = 0; while(blockType != BT_END) { if(progmon != null && progmon.isCanceled()) System.exit(0); DataInputStream dis = new DataInputStream(new ByteArrayInputStream(data)); int bytesSkipped = 0; while(bytesSkipped < offset) bytesSkipped += dis.skipBytes(offset-bytesSkipped); blockType = dis.readInt(); int skipped = dis.readInt(); //Skip 4 bytes forward outOffset = dis.readLong()*0x200;//(dis.readInt() & 0xffffffffL)*0x200; //unsigned int -> long //dis.readInt(); //Skip 4 bytes forward outSize = dis.readLong()*0x200;//(dis.readInt() & 0xffffffffL)*0x200; //unsigned int -> long inOffset = dis.readLong();// & 0xffffffffL; //unsigned int -> long //dis.readInt(); //Skip 4 bytes forward inSize = dis.readLong();//dis.readInt() & 0xffffffffL; //unsigned int -> long if(lastByteReadInBlock == -1) lastByteReadInBlock = inOffset; lastByteReadInBlock += inSize; /* The lines below are a "hack" that I had to do to make dmgx work with certain dmg-files. I don't understand the issue at all, which is why this hack is here, but sometimes inOffset == 0 means that it is 0 relative to the previous partition's last inOffset. And sometimes it doesn't (meaning the actual position 0 in the dmg file). */ if(addInOffset) { if(DEBUG) println("!-----addInOffset mode: inOffset tranformation " + inOffset + "->" + (inOffset+lastInOffset)); inOffset += lastInOffset; } else if(inOffset == 0) { if(DEBUG) println("!-----Detected inOffset == 0, setting to " + lastInOffset); addInOffset = true; inOffset = lastInOffset; } outOffset += lastOutOffset; DMGBlock currentBlock = new DMGBlock(blockType, skipped, outOffset, outSize, inOffset, inSize); blocks.add(currentBlock); if(DEBUG) { println("outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize + " lastOutOffset=" + lastOutOffset + " lastInOffset=" + lastInOffset /*+ " lastInOffs=" + lastInOffs + " lastOffs=" + lastOffs*/); } if(blockType == BT_ADC) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_ADC not supported."); ++errorsReported; if(!testOnly) System.exit(0); } else if(blockType == BT_ZLIB) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZLIB processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZLIB FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); try { DMGBlockHandlers.processZlibBlock(currentBlock, dmgRaf, isoRaf, testOnly, dummyMonitor); } catch(DataFormatException dfe) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_ZLIB Could not decode..."); ++errorsReported; if(!DEBUG) { println("outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize + " lastOutOffset=" + lastOutOffset + " lastInOffset=" + lastInOffset); } dfe.printStackTrace(); if(!testOnly) System.exit(0); else { println(" Testing mode, so continuing..."); //System.exit(0); break; } } } else if(blockType == BT_BZIP2) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_BZIP2 not currently supported."); ++errorsReported; if(!testOnly) System.exit(0); } else if(blockType == BT_COPY) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_COPY processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_COPY FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } dmgRaf.seek(/*lastOffs+*/inOffset); int bytesRead = dmgRaf.read(inBuffer, 0, Math.min((int)inSize, inBuffer.length)); long totalBytesRead = bytesRead; while(bytesRead != -1) { reportFilePointerProgress(dmgRaf); if(!testOnly) isoRaf.write(inBuffer, 0, bytesRead); if(totalBytesRead >= inSize) break; bytesRead = dmgRaf.read(inBuffer, 0, Math.min((int)(inSize-totalBytesRead), inBuffer.length)); if(bytesRead > 0) totalBytesRead += bytesRead; } //lastInOffs = inOffset+inSize; } else if(blockType == BT_ZERO) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZERO processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZERO FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } reportFilePointerProgress(dmgRaf); long numberOfZeroBlocks = outSize/zeroblock.length; int numberOfRemainingBytes = (int)(outSize%zeroblock.length); for(int j = 0; j < numberOfZeroBlocks; ++j) { if(!testOnly) isoRaf.write(zeroblock); } if(!testOnly) isoRaf.write(zeroblock, 0, numberOfRemainingBytes); //lastInOffs = inOffset+inSize; } else if(blockType == BT_ZERO2) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZERO2 processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZERO2 FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } reportFilePointerProgress(dmgRaf); long numberOfZeroBlocks = outSize/zeroblock.length; int numberOfRemainingBytes = (int)(outSize%zeroblock.length); for(int j = 0; j < numberOfZeroBlocks; ++j) { if(!testOnly) isoRaf.write(zeroblock); } if(!testOnly) isoRaf.write(zeroblock, 0, numberOfRemainingBytes); //lastInOffs = inOffset+inSize; } else if(blockType == BT_UNKNOWN) { /* I have no idea what this blocktype is... but it's common, and usually doesn't appear more than 2-3 times in a dmg. As long as its input and output sizes are 0, there's no reason to complain... is there? */ if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_UNKNOWN processing..."); if(!(inSize == 0 && outSize == 0)) { println(" " + elementNumber + ":" + blockCount + ". WARNING: Blocktype BT_UNKNOWN had non-zero sizes...", " inSize=" + inSize + ", outSize=" + outSize); ++warningsReported; //println(" The author of the program would be pleased if you contacted him about this."); // ...or would I? } } else if(blockType == BT_END) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_END processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_END FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); //lastOffs += lastInOffs; lastOutOffset = outOffset; lastInOffset += lastByteReadInBlock; } else { println(" " + elementNumber + ":" + blockCount + ". WARNING: previously unseen blocktype " + blockType + " [0x" + Integer.toHexString(blockType) + "]", " " + elementNumber + ":" + blockCount + ". outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize); ++warningsReported; if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". unknown blocktype FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); } offset += 0x28; ++blockCount; } } ++elementNumber; } //printlnVerbose("Progress: 100% Done!"); reportProgress(100); String summary = (errorsReported != 0)?errorsReported+" errors reported":"No errors reported"; summary += (warningsReported != 0)?" ("+warningsReported+" warnings emitted).":"."; if(!graphical) { newline(); println(summary); printlnVerbose("Total extracted bytes: " + totalSize + " B"); } else { progmon.close(); JOptionPane.showMessageDialog(null, "Extraction complete! " + summary + "\n" + "Total extracted bytes: " + totalSize + " B", "Information", JOptionPane.INFORMATION_MESSAGE); System.exit(0); } if(!DEBUG) { if(isoRaf != null) isoRaf.close(); dmgRaf.close(); } else { if(isoRaf != null) isoRaf.close();// System.out.println("blocks.size()=" + blocks.size());// for(DMGBlock b : blocks)// System.out.println(" " + b.toString()); LinkedList<DMGBlock> merged = mergeBlocks(blocks);// System.out.println("merged.size()=" + merged.size());// for(DMGBlock b : merged)// System.out.println(" " + b.toString()); println("Extracting all the parts not containing block data from source file:"); int i = 1; DMGBlock previous = null; for(DMGBlock b : merged) { if(previous == null && b.inOffset > 0) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(0); byte[] data = new byte[(int)(b.inOffset)]; dmgRaf.read(data); curFos.write(data); curFos.close(); } else if(previous != null) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(previous.inOffset+previous.inSize); byte[] data = new byte[(int)(b.inOffset-(previous.inOffset+previous.inSize))]; dmgRaf.read(data); curFos.write(data); curFos.close(); } previous = b; } if(previous.inOffset+previous.inSize != dmgRaf.length()) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(previous.inOffset+previous.inSize); byte[] data = new byte[(int)(dmgRaf.length()-(previous.inOffset+previous.inSize))]; dmgRaf.read(data); curFos.write(data); curFos.close(); } dmgRaf.close(); System.out.println("done!"); } }
1,114,672
public static void notmain(String[] args) throws Exception { if(DEBUG) verbose = true; parseArgs(args); printlnVerbose("Processing: " + dmgFile); RandomAccessFile dmgRaf = new RandomAccessFile(dmgFile, "r"); RandomAccessFile isoRaf = null; boolean testOnly = false; if(isoFile != null) { isoRaf = new RandomAccessFile(isoFile, "rw"); isoRaf.setLength(0); printlnVerbose("Extracting to: " + isoFile); } else { testOnly = true; printlnVerbose("Simulating extraction..."); } dmgRaf.seek(dmgRaf.length()-PLIST_ADDRESS_1); long plistBegin1 = dmgRaf.readLong(); long plistEnd = dmgRaf.readLong(); dmgRaf.seek(dmgRaf.length()-PLIST_ADDRESS_2); long plistBegin2 = dmgRaf.readLong(); long plistSize = dmgRaf.readLong(); if(DEBUG) { println("Read addresses:", " " + plistBegin1, " " + plistBegin2); } if(plistBegin1 != plistBegin2) { println("Addresses not equal! Assumption broken... =/", plistBegin1 + " != " + plistBegin2); System.exit(0); } if(plistSize != (plistEnd-plistBegin1)) { println("plistSize field does not match plistEnd marker!", "plistSize=" + plistSize + " plistBegin1=" + plistBegin1 + " plistEnd=" + plistEnd + " plistEnd-plistBegin1=" + (plistEnd-plistBegin1)); } printlnVerbose("Jumping to address..."); dmgRaf.seek(plistBegin1); byte[] buffer = new byte[(int)plistSize]; dmgRaf.read(buffer); InputStream is = new ByteArrayInputStream(buffer); NodeBuilder handler = new NodeBuilder(); SAXParser saxParser = SAXParserFactory.newInstance().newSAXParser(); try {// System.out.println("validation: " + saxParser.getProperty("validation"));// System.out.println("external-general-entities: " + saxParser.getProperty("external-general-entities"));// System.out.println("external-parameter-entities: " + saxParser.getProperty("external-parameter-entities"));// System.out.println("is-standalone: " + saxParser.getProperty("is-standalone"));// System.out.println("lexical-handler: " + saxParser.getProperty("lexical-handler"));// System.out.println("parameter-entities: " + saxParser.getProperty("parameter-entities"));// System.out.println("namespaces: " + saxParser.getProperty("namespaces"));// System.out.println("namespace-prefixes: " + saxParser.getProperty("namespace-prefixes"));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty("")); //System.out.println("isValidating: " + saxParser.isValidating()); saxParser.parse(is, handler); } catch(SAXException se) { se.printStackTrace(); System.err.println("Could not read the partition list... exiting."); System.exit(1); } XMLNode[] rootNodes = handler.getRoots(); if(rootNodes.length != 1) { println("Could not parse DMG-file!"); System.exit(0); } /* Ok, now we have a tree built from the XML-document. Let's walk to the right place. */ /* cd plist cd dict cdkey resource-fork (type:dict) cdkey blkx (type:array) */ XMLNode current; XMLElement[] children; boolean keyFound; current = rootNodes[0]; //We are at plist... probably (there should be only one root node) current = current.cd("dict"); current = current.cdkey("resource-fork"); current = current.cdkey("blkx"); printlnVerbose("Found " + current.getChildren().length + " partitions:"); byte[] inBuffer = new byte[0x40000]; byte[] outBuffer = new byte[0x40000]; byte[] zeroblock = new byte[4096]; /* I think java always zeroes its arrays on creation... but let's play safe. */ for(int y = 0; y < zeroblock.length; ++y) zeroblock[y] = 0; LinkedList<DMGBlock> blocks = new LinkedList<DMGBlock>(); long elementNumber = 0; //long lastOffs = 0; long lastOutOffset = 0; long lastInOffset = 0; long totalSize = 0; int errorsReported = 0; int warningsReported = 0; reportProgress(0); for(XMLElement xe : current.getChildren()) { if(progmon != null && progmon.isCanceled()) System.exit(0); if(xe instanceof XMLNode) { XMLNode xn = (XMLNode)xe; byte[] data = Base64.decode(xn.getKeyValue("Data")); long partitionSize = calculatePartitionSize(data); totalSize += partitionSize; printlnVerbose(" " + xn.getKeyValue("Name")); printlnVerbose(" ID: " + xn.getKeyValue("ID")); printlnVerbose(" Attributes: " + xn.getKeyValue("Attributes")); printlnVerbose(" Partition map data length: " + data.length + " bytes"); printlnVerbose(" Partition size: " + partitionSize + " bytes"); if(verbose) { printlnVerbose(" Dumping blkx..."); FileOutputStream fos = new FileOutputStream(xn.getKeyValue("ID") + ".blkx"); fos.write(data); fos.close(); } if(DEBUG) { File dumpFile = new File("data " + xn.getKeyValue("ID") + ".bin"); println(" Dumping partition map to file: " + dumpFile); FileOutputStream dump = new FileOutputStream(dumpFile); dump.write(data); dump.close(); } int offset = 0xCC; int blockType = 0; /* Offset of the input data for the current block in the input file */ long inOffset = 0; /* Size of the input data for the current block */ long inSize = 0; /* Offset of the output data for the current block in the output file */ long outOffset = 0; /* Size of the output data (possibly larger than inSize because of decompression, zero expansion...) */ long outSize = 0; long lastByteReadInBlock = -1; boolean addInOffset = false; //, lastInOffs = 0; int blockCount = 0; while(blockType != BT_END) { if(progmon != null && progmon.isCanceled()) System.exit(0); DataInputStream dis = new DataInputStream(new ByteArrayInputStream(data)); int bytesSkipped = 0; while(bytesSkipped < offset) bytesSkipped += dis.skipBytes(offset-bytesSkipped); blockType = dis.readInt(); int skipped = dis.readInt(); //Skip 4 bytes forward outOffset = dis.readLong()*0x200;//(dis.readInt() & 0xffffffffL)*0x200; //unsigned int -> long //dis.readInt(); //Skip 4 bytes forward outSize = dis.readLong()*0x200;//(dis.readInt() & 0xffffffffL)*0x200; //unsigned int -> long inOffset = dis.readLong();// & 0xffffffffL; //unsigned int -> long //dis.readInt(); //Skip 4 bytes forward inSize = dis.readLong();//dis.readInt() & 0xffffffffL; //unsigned int -> long if(lastByteReadInBlock == -1) lastByteReadInBlock = inOffset; lastByteReadInBlock += inSize; /* The lines below are a "hack" that I had to do to make dmgx work with certain dmg-files. I don't understand the issue at all, which is why this hack is here, but sometimes inOffset == 0 means that it is 0 relative to the previous partition's last inOffset. And sometimes it doesn't (meaning the actual position 0 in the dmg file). */ if(addInOffset) { if(DEBUG) println("!-----addInOffset mode: inOffset tranformation " + inOffset + "->" + (inOffset+lastInOffset)); inOffset += lastInOffset; } else if(inOffset == 0) { if(DEBUG) println("!-----Detected inOffset == 0, setting to " + lastInOffset); addInOffset = true; inOffset = lastInOffset; } outOffset += lastOutOffset; DMGBlock currentBlock = new DMGBlock(blockType, skipped, outOffset, outSize, inOffset, inSize); blocks.add(currentBlock); if(DEBUG) { println("outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize + " lastOutOffset=" + lastOutOffset + " lastInOffset=" + lastInOffset /*+ " lastInOffs=" + lastInOffs + " lastOffs=" + lastOffs*/); } if(blockType == BT_ADC) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_ADC not supported."); ++errorsReported; if(!testOnly) System.exit(0); } else if(blockType == BT_ZLIB) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZLIB processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZLIB FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); try { DMGBlockHandlers.processZlibBlock(currentBlock, dmgRaf, isoRaf, testOnly, dummyMonitor); } catch(DataFormatException dfe) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_ZLIB Could not decode..."); ++errorsReported; if(!DEBUG) { println("outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize + " lastOutOffset=" + lastOutOffset + " lastInOffset=" + lastInOffset); } dfe.printStackTrace(); if(!testOnly) System.exit(0); else { println(" Testing mode, so continuing..."); //System.exit(0); break; } } } else if(blockType == BT_BZIP2) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_BZIP2 not currently supported."); ++errorsReported; if(!testOnly) System.exit(0); } else if(blockType == BT_COPY) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_COPY processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_COPY FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } dmgRaf.seek(/*lastOffs+*/inOffset); int bytesRead = dmgRaf.read(inBuffer, 0, Math.min((int)inSize, inBuffer.length)); long totalBytesRead = bytesRead; while(bytesRead != -1) { reportFilePointerProgress(dmgRaf); if(!testOnly) isoRaf.write(inBuffer, 0, bytesRead); if(totalBytesRead >= inSize) break; bytesRead = dmgRaf.read(inBuffer, 0, Math.min((int)(inSize-totalBytesRead), inBuffer.length)); if(bytesRead > 0) totalBytesRead += bytesRead; } //lastInOffs = inOffset+inSize; } else if(blockType == BT_ZERO) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZERO processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZERO FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } reportFilePointerProgress(dmgRaf); long numberOfZeroBlocks = outSize/zeroblock.length; int numberOfRemainingBytes = (int)(outSize%zeroblock.length); for(int j = 0; j < numberOfZeroBlocks; ++j) { if(!testOnly) isoRaf.write(zeroblock); } if(!testOnly) isoRaf.write(zeroblock, 0, numberOfRemainingBytes); //lastInOffs = inOffset+inSize; } else if(blockType == BT_ZERO2) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZERO2 processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZERO2 FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } reportFilePointerProgress(dmgRaf); long numberOfZeroBlocks = outSize/zeroblock.length; int numberOfRemainingBytes = (int)(outSize%zeroblock.length); for(int j = 0; j < numberOfZeroBlocks; ++j) { if(!testOnly) isoRaf.write(zeroblock); } if(!testOnly) isoRaf.write(zeroblock, 0, numberOfRemainingBytes); //lastInOffs = inOffset+inSize; } else if(blockType == BT_UNKNOWN) { /* I have no idea what this blocktype is... but it's common, and usually doesn't appear more than 2-3 times in a dmg. As long as its input and output sizes are 0, there's no reason to complain... is there? */ if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_UNKNOWN processing..."); if(!(inSize == 0 && outSize == 0)) { println(" " + elementNumber + ":" + blockCount + ". WARNING: Blocktype BT_UNKNOWN had non-zero sizes...", " inSize=" + inSize + ", outSize=" + outSize); ++warningsReported; //println(" The author of the program would be pleased if you contacted him about this."); // ...or would I? } } else if(blockType == BT_END) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_END processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_END FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); //lastOffs += lastInOffs; lastOutOffset = outOffset; lastInOffset += lastByteReadInBlock; } else { println(" " + elementNumber + ":" + blockCount + ". WARNING: previously unseen blocktype " + blockType + " [0x" + Integer.toHexString(blockType) + "]", " " + elementNumber + ":" + blockCount + ". outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize); ++warningsReported; if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". unknown blocktype FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); } offset += 0x28; ++blockCount; } } ++elementNumber; } //printlnVerbose("Progress: 100% Done!"); reportProgress(100); String summary = (errorsReported != 0)?errorsReported+" errors reported":"No errors reported"; summary += (warningsReported != 0)?" ("+warningsReported+" warnings emitted).":"."; if(!graphical) { newline(); println(summary); printlnVerbose("Total extracted bytes: " + totalSize + " B"); } else { progmon.close(); JOptionPane.showMessageDialog(null, "Extraction complete! " + summary + "\n" + "Total extracted bytes: " + totalSize + " B", "Information", JOptionPane.INFORMATION_MESSAGE); System.exit(0); } if(!DEBUG) { if(isoRaf != null) isoRaf.close(); dmgRaf.close(); } else { if(isoRaf != null) isoRaf.close();// System.out.println("blocks.size()=" + blocks.size());// for(DMGBlock b : blocks)// System.out.println(" " + b.toString()); LinkedList<DMGBlock> merged = mergeBlocks(blocks);// System.out.println("merged.size()=" + merged.size());// for(DMGBlock b : merged)// System.out.println(" " + b.toString()); println("Extracting all the parts not containing block data from source file:"); int i = 1; DMGBlock previous = null; for(DMGBlock b : merged) { if(previous == null && b.inOffset > 0) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(0); byte[] data = new byte[(int)(b.inOffset)]; dmgRaf.read(data); curFos.write(data); curFos.close(); } else if(previous != null) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(previous.inOffset+previous.inSize); byte[] data = new byte[(int)(b.inOffset-(previous.inOffset+previous.inSize))]; dmgRaf.read(data); curFos.write(data); curFos.close(); } previous = b; } if(previous.inOffset+previous.inSize != dmgRaf.length()) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(previous.inOffset+previous.inSize); byte[] data = new byte[(int)(dmgRaf.length()-(previous.inOffset+previous.inSize))]; dmgRaf.read(data); curFos.write(data); curFos.close(); } dmgRaf.close(); System.out.println("done!"); } }
public static void notmain(String[] args) throws Exception { if(DEBUG) verbose = true; parseArgs(args); printlnVerbose("Processing: " + dmgFile); RandomAccessFile dmgRaf = new RandomAccessFile(dmgFile, "r"); RandomAccessFile isoRaf = null; boolean testOnly = false; if(isoFile != null) { isoRaf = new RandomAccessFile(isoFile, "rw"); isoRaf.setLength(0); printlnVerbose("Extracting to: " + isoFile); } else { testOnly = true; printlnVerbose("Simulating extraction..."); } dmgRaf.seek(dmgRaf.length()-PLIST_ADDRESS_1); long plistBegin1 = dmgRaf.readLong(); long plistEnd = dmgRaf.readLong(); dmgRaf.seek(dmgRaf.length()-PLIST_ADDRESS_2); long plistBegin2 = dmgRaf.readLong(); long plistSize = dmgRaf.readLong(); if(DEBUG) { println("Read addresses:", " " + plistBegin1, " " + plistBegin2); } if(plistBegin1 != plistBegin2) { println("Addresses not equal! Assumption broken... =/", plistBegin1 + " != " + plistBegin2); System.exit(0); } if(plistSize != (plistEnd-plistBegin1)) { println("plistSize field does not match plistEnd marker!", "plistSize=" + plistSize + " plistBegin1=" + plistBegin1 + " plistEnd=" + plistEnd + " plistEnd-plistBegin1=" + (plistEnd-plistBegin1)); } printlnVerbose("Jumping to address..."); dmgRaf.seek(plistBegin1); byte[] buffer = new byte[(int)plistSize]; dmgRaf.read(buffer); InputStream is = new ByteArrayInputStream(buffer); NodeBuilder handler = new NodeBuilder(); SAXParser saxParser = SAXParserFactory.newInstance().newSAXParser(); try {// System.out.println("validation: " + saxParser.getProperty("validation"));// System.out.println("external-general-entities: " + saxParser.getProperty("external-general-entities"));// System.out.println("external-parameter-entities: " + saxParser.getProperty("external-parameter-entities"));// System.out.println("is-standalone: " + saxParser.getProperty("is-standalone"));// System.out.println("lexical-handler: " + saxParser.getProperty("lexical-handler"));// System.out.println("parameter-entities: " + saxParser.getProperty("parameter-entities"));// System.out.println("namespaces: " + saxParser.getProperty("namespaces"));// System.out.println("namespace-prefixes: " + saxParser.getProperty("namespace-prefixes"));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty("")); //System.out.println("isValidating: " + saxParser.isValidating()); saxParser.parse(is, handler); } catch(SAXException se) { se.printStackTrace(); System.err.println("Could not read the partition list... exiting."); System.exit(1); } XMLNode[] rootNodes = handler.getRoots(); if(rootNodes.length != 1) { println("Could not parse DMG-file!"); System.exit(0); } /* Ok, now we have a tree built from the XML-document. Let's walk to the right place. */ /* cd plist cd dict cdkey resource-fork (type:dict) cdkey blkx (type:array) */ XMLNode current; XMLElement[] children; boolean keyFound; current = rootNodes[0]; //We are at plist... probably (there should be only one root node) current = current.cd("dict"); current = current.cdkey("resource-fork"); current = current.cdkey("blkx"); printlnVerbose("Found " + current.getChildren().length + " partitions:"); byte[] inBuffer = new byte[0x40000]; byte[] outBuffer = new byte[0x40000]; byte[] zeroblock = new byte[4096]; /* I think java always zeroes its arrays on creation... but let's play safe. */ for(int y = 0; y < zeroblock.length; ++y) zeroblock[y] = 0; LinkedList<DMGBlock> blocks = new LinkedList<DMGBlock>(); long elementNumber = 0; //long lastOffs = 0; long lastOutOffset = 0; long lastInOffset = 0; long totalSize = 0; int errorsReported = 0; int warningsReported = 0; reportProgress(0); for(XMLElement xe : current.getChildren()) { if(progmon != null && progmon.isCanceled()) System.exit(0); if(xe instanceof XMLNode) { XMLNode xn = (XMLNode)xe; byte[] data = Base64.decode(xn.getKeyValue("Data")); long partitionSize = calculatePartitionSize(data); totalSize += partitionSize; printlnVerbose(" " + xn.getKeyValue("Name")); printlnVerbose(" ID: " + xn.getKeyValue("ID")); printlnVerbose(" Attributes: " + xn.getKeyValue("Attributes")); printlnVerbose(" Partition map data length: " + data.length + " bytes"); printlnVerbose(" Partition size: " + partitionSize + " bytes"); if(verbose) { printlnVerbose(" Dumping blkx..."); FileOutputStream fos = new FileOutputStream(xn.getKeyValue("ID") + ".blkx"); fos.write(data); fos.close(); } if(DEBUG) { File dumpFile = new File("data " + xn.getKeyValue("ID") + ".bin"); println(" Dumping partition map to file: " + dumpFile); FileOutputStream dump = new FileOutputStream(dumpFile); dump.write(data); dump.close(); } int offset = 0xCC; int blockType = 0; /* Offset of the input data for the current block in the input file */ long inOffset = 0; /* Size of the input data for the current block */ long inSize = 0; /* Offset of the output data for the current block in the output file */ long outOffset = 0; /* Size of the output data (possibly larger than inSize because of decompression, zero expansion...) */ long outSize = 0; long lastByteReadInBlock = -1; boolean addInOffset = false; //, lastInOffs = 0; int blockCount = 0; while(blockType != BT_END) { if(progmon != null && progmon.isCanceled()) System.exit(0); DataInputStream dis = new DataInputStream(new ByteArrayInputStream(data)); int bytesSkipped = 0; while(bytesSkipped < offset) bytesSkipped += dis.skipBytes(offset-bytesSkipped); blockType = dis.readInt(); int skipped = dis.readInt(); //Skip 4 bytes forward outOffset = dis.readLong()*0x200;//(dis.readInt() & 0xffffffffL)*0x200; //unsigned int -> long //dis.readInt(); //Skip 4 bytes forward outSize = dis.readLong()*0x200;//(dis.readInt() & 0xffffffffL)*0x200; //unsigned int -> long inOffset = dis.readLong();// & 0xffffffffL; //unsigned int -> long //dis.readInt(); //Skip 4 bytes forward inSize = dis.readLong();//dis.readInt() & 0xffffffffL; //unsigned int -> long if(lastByteReadInBlock == -1) lastByteReadInBlock = inOffset; lastByteReadInBlock += inSize; /* The lines below are a "hack" that I had to do to make dmgx work with certain dmg-files. I don't understand the issue at all, which is why this hack is here, but sometimes inOffset == 0 means that it is 0 relative to the previous partition's last inOffset. And sometimes it doesn't (meaning the actual position 0 in the dmg file). */ if(addInOffset) { if(DEBUG) println("!-----addInOffset mode: inOffset tranformation " + inOffset + "->" + (inOffset+lastInOffset)); inOffset += lastInOffset; } else if(inOffset == 0) { if(DEBUG) println("!-----Detected inOffset == 0, setting to " + lastInOffset); addInOffset = true; inOffset = lastInOffset; } outOffset += lastOutOffset; DMGBlock currentBlock = new DMGBlock(blockType, skipped, outOffset, outSize, inOffset, inSize); blocks.add(currentBlock); if(DEBUG) { println("outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize + " lastOutOffset=" + lastOutOffset + " lastInOffset=" + lastInOffset /*+ " lastInOffs=" + lastInOffs + " lastOffs=" + lastOffs*/); } if(blockType == BT_ADC) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_ADC not supported."); ++errorsReported; if(!testOnly) System.exit(0); } else if(blockType == BT_ZLIB) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZLIB processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZLIB FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); try { DMGBlockHandlers.processZlibBlock(currentBlock, dmgRaf, isoRaf, testOnly, dummyMonitor); } catch(DataFormatException dfe) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_ZLIB Could not decode..."); ++errorsReported; if(!DEBUG) { println("outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize + " lastOutOffset=" + lastOutOffset + " lastInOffset=" + lastInOffset); } dfe.printStackTrace(); if(!testOnly) System.exit(0); else { println(" Testing mode, so continuing..."); //System.exit(0); break; } } } else if(blockType == BT_BZIP2) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_BZIP2 not currently supported."); ++errorsReported; if(!testOnly) System.exit(0); } else if(blockType == BT_COPY) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_COPY processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_COPY FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } dmgRaf.seek(/*lastOffs+*/inOffset); int bytesRead = dmgRaf.read(inBuffer, 0, Math.min((int)inSize, inBuffer.length)); long totalBytesRead = bytesRead; while(bytesRead != -1) { reportFilePointerProgress(dmgRaf); if(!testOnly) isoRaf.write(inBuffer, 0, bytesRead); if(totalBytesRead >= inSize) break; bytesRead = dmgRaf.read(inBuffer, 0, Math.min((int)(inSize-totalBytesRead), inBuffer.length)); if(bytesRead > 0) totalBytesRead += bytesRead; } //lastInOffs = inOffset+inSize; } else if(blockType == BT_ZERO) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZERO processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZERO FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } reportFilePointerProgress(dmgRaf); long numberOfZeroBlocks = outSize/zeroblock.length; int numberOfRemainingBytes = (int)(outSize%zeroblock.length); for(int j = 0; j < numberOfZeroBlocks; ++j) { if(!testOnly) isoRaf.write(zeroblock); } if(!testOnly) isoRaf.write(zeroblock, 0, numberOfRemainingBytes); //lastInOffs = inOffset+inSize; } else if(blockType == BT_ZERO2) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZERO2 processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println("!------>WARNING: BT_ZERO2 FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } reportFilePointerProgress(dmgRaf); long numberOfZeroBlocks = outSize/zeroblock.length; int numberOfRemainingBytes = (int)(outSize%zeroblock.length); for(int j = 0; j < numberOfZeroBlocks; ++j) { if(!testOnly) isoRaf.write(zeroblock); } if(!testOnly) isoRaf.write(zeroblock, 0, numberOfRemainingBytes); //lastInOffs = inOffset+inSize; } else if(blockType == BT_UNKNOWN) { /* I have no idea what this blocktype is... but it's common, and usually doesn't appear more than 2-3 times in a dmg. As long as its input and output sizes are 0, there's no reason to complain... is there? */ if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_UNKNOWN processing..."); if(!(inSize == 0 && outSize == 0)) { println(" " + elementNumber + ":" + blockCount + ". WARNING: Blocktype BT_UNKNOWN had non-zero sizes...", " inSize=" + inSize + ", outSize=" + outSize); ++warningsReported; //println(" The author of the program would be pleased if you contacted him about this."); // ...or would I? } } else if(blockType == BT_END) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_END processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_END FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); //lastOffs += lastInOffs; lastOutOffset = outOffset; lastInOffset += lastByteReadInBlock; } else { println(" " + elementNumber + ":" + blockCount + ". WARNING: previously unseen blocktype " + blockType + " [0x" + Integer.toHexString(blockType) + "]", " " + elementNumber + ":" + blockCount + ". outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize); ++warningsReported; if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". unknown blocktype FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); } offset += 0x28; ++blockCount; } } ++elementNumber; } //printlnVerbose("Progress: 100% Done!"); reportProgress(100); String summary = (errorsReported != 0)?errorsReported+" errors reported":"No errors reported"; summary += (warningsReported != 0)?" ("+warningsReported+" warnings emitted).":"."; if(!graphical) { newline(); println(summary); printlnVerbose("Total extracted bytes: " + totalSize + " B"); } else { progmon.close(); JOptionPane.showMessageDialog(null, "Extraction complete! " + summary + "\n" + "Total extracted bytes: " + totalSize + " B", "Information", JOptionPane.INFORMATION_MESSAGE); System.exit(0); } if(!DEBUG) { if(isoRaf != null) isoRaf.close(); dmgRaf.close(); } else { if(isoRaf != null) isoRaf.close();// System.out.println("blocks.size()=" + blocks.size());// for(DMGBlock b : blocks)// System.out.println(" " + b.toString()); LinkedList<DMGBlock> merged = mergeBlocks(blocks);// System.out.println("merged.size()=" + merged.size());// for(DMGBlock b : merged)// System.out.println(" " + b.toString()); println("Extracting all the parts not containing block data from source file:"); int i = 1; DMGBlock previous = null; for(DMGBlock b : merged) { if(previous == null && b.inOffset > 0) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(0); byte[] data = new byte[(int)(b.inOffset)]; dmgRaf.read(data); curFos.write(data); curFos.close(); } else if(previous != null) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(previous.inOffset+previous.inSize); byte[] data = new byte[(int)(b.inOffset-(previous.inOffset+previous.inSize))]; dmgRaf.read(data); curFos.write(data); curFos.close(); } previous = b; } if(previous.inOffset+previous.inSize != dmgRaf.length()) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(previous.inOffset+previous.inSize); byte[] data = new byte[(int)(dmgRaf.length()-(previous.inOffset+previous.inSize))]; dmgRaf.read(data); curFos.write(data); curFos.close(); } dmgRaf.close(); System.out.println("done!"); } }
1,114,673
public static void notmain(String[] args) throws Exception { if(DEBUG) verbose = true; parseArgs(args); printlnVerbose("Processing: " + dmgFile); RandomAccessFile dmgRaf = new RandomAccessFile(dmgFile, "r"); RandomAccessFile isoRaf = null; boolean testOnly = false; if(isoFile != null) { isoRaf = new RandomAccessFile(isoFile, "rw"); isoRaf.setLength(0); printlnVerbose("Extracting to: " + isoFile); } else { testOnly = true; printlnVerbose("Simulating extraction..."); } dmgRaf.seek(dmgRaf.length()-PLIST_ADDRESS_1); long plistBegin1 = dmgRaf.readLong(); long plistEnd = dmgRaf.readLong(); dmgRaf.seek(dmgRaf.length()-PLIST_ADDRESS_2); long plistBegin2 = dmgRaf.readLong(); long plistSize = dmgRaf.readLong(); if(DEBUG) { println("Read addresses:", " " + plistBegin1, " " + plistBegin2); } if(plistBegin1 != plistBegin2) { println("Addresses not equal! Assumption broken... =/", plistBegin1 + " != " + plistBegin2); System.exit(0); } if(plistSize != (plistEnd-plistBegin1)) { println("plistSize field does not match plistEnd marker!", "plistSize=" + plistSize + " plistBegin1=" + plistBegin1 + " plistEnd=" + plistEnd + " plistEnd-plistBegin1=" + (plistEnd-plistBegin1)); } printlnVerbose("Jumping to address..."); dmgRaf.seek(plistBegin1); byte[] buffer = new byte[(int)plistSize]; dmgRaf.read(buffer); InputStream is = new ByteArrayInputStream(buffer); NodeBuilder handler = new NodeBuilder(); SAXParser saxParser = SAXParserFactory.newInstance().newSAXParser(); try {// System.out.println("validation: " + saxParser.getProperty("validation"));// System.out.println("external-general-entities: " + saxParser.getProperty("external-general-entities"));// System.out.println("external-parameter-entities: " + saxParser.getProperty("external-parameter-entities"));// System.out.println("is-standalone: " + saxParser.getProperty("is-standalone"));// System.out.println("lexical-handler: " + saxParser.getProperty("lexical-handler"));// System.out.println("parameter-entities: " + saxParser.getProperty("parameter-entities"));// System.out.println("namespaces: " + saxParser.getProperty("namespaces"));// System.out.println("namespace-prefixes: " + saxParser.getProperty("namespace-prefixes"));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty("")); //System.out.println("isValidating: " + saxParser.isValidating()); saxParser.parse(is, handler); } catch(SAXException se) { se.printStackTrace(); System.err.println("Could not read the partition list... exiting."); System.exit(1); } XMLNode[] rootNodes = handler.getRoots(); if(rootNodes.length != 1) { println("Could not parse DMG-file!"); System.exit(0); } /* Ok, now we have a tree built from the XML-document. Let's walk to the right place. */ /* cd plist cd dict cdkey resource-fork (type:dict) cdkey blkx (type:array) */ XMLNode current; XMLElement[] children; boolean keyFound; current = rootNodes[0]; //We are at plist... probably (there should be only one root node) current = current.cd("dict"); current = current.cdkey("resource-fork"); current = current.cdkey("blkx"); printlnVerbose("Found " + current.getChildren().length + " partitions:"); byte[] inBuffer = new byte[0x40000]; byte[] outBuffer = new byte[0x40000]; byte[] zeroblock = new byte[4096]; /* I think java always zeroes its arrays on creation... but let's play safe. */ for(int y = 0; y < zeroblock.length; ++y) zeroblock[y] = 0; LinkedList<DMGBlock> blocks = new LinkedList<DMGBlock>(); long elementNumber = 0; //long lastOffs = 0; long lastOutOffset = 0; long lastInOffset = 0; long totalSize = 0; int errorsReported = 0; int warningsReported = 0; reportProgress(0); for(XMLElement xe : current.getChildren()) { if(progmon != null && progmon.isCanceled()) System.exit(0); if(xe instanceof XMLNode) { XMLNode xn = (XMLNode)xe; byte[] data = Base64.decode(xn.getKeyValue("Data")); long partitionSize = calculatePartitionSize(data); totalSize += partitionSize; printlnVerbose(" " + xn.getKeyValue("Name")); printlnVerbose(" ID: " + xn.getKeyValue("ID")); printlnVerbose(" Attributes: " + xn.getKeyValue("Attributes")); printlnVerbose(" Partition map data length: " + data.length + " bytes"); printlnVerbose(" Partition size: " + partitionSize + " bytes"); if(verbose) { printlnVerbose(" Dumping blkx..."); FileOutputStream fos = new FileOutputStream(xn.getKeyValue("ID") + ".blkx"); fos.write(data); fos.close(); } if(DEBUG) { File dumpFile = new File("data " + xn.getKeyValue("ID") + ".bin"); println(" Dumping partition map to file: " + dumpFile); FileOutputStream dump = new FileOutputStream(dumpFile); dump.write(data); dump.close(); } int offset = 0xCC; int blockType = 0; /* Offset of the input data for the current block in the input file */ long inOffset = 0; /* Size of the input data for the current block */ long inSize = 0; /* Offset of the output data for the current block in the output file */ long outOffset = 0; /* Size of the output data (possibly larger than inSize because of decompression, zero expansion...) */ long outSize = 0; long lastByteReadInBlock = -1; boolean addInOffset = false; //, lastInOffs = 0; int blockCount = 0; while(blockType != BT_END) { if(progmon != null && progmon.isCanceled()) System.exit(0); DataInputStream dis = new DataInputStream(new ByteArrayInputStream(data)); int bytesSkipped = 0; while(bytesSkipped < offset) bytesSkipped += dis.skipBytes(offset-bytesSkipped); blockType = dis.readInt(); int skipped = dis.readInt(); //Skip 4 bytes forward outOffset = dis.readLong()*0x200;//(dis.readInt() & 0xffffffffL)*0x200; //unsigned int -> long //dis.readInt(); //Skip 4 bytes forward outSize = dis.readLong()*0x200;//(dis.readInt() & 0xffffffffL)*0x200; //unsigned int -> long inOffset = dis.readLong();// & 0xffffffffL; //unsigned int -> long //dis.readInt(); //Skip 4 bytes forward inSize = dis.readLong();//dis.readInt() & 0xffffffffL; //unsigned int -> long if(lastByteReadInBlock == -1) lastByteReadInBlock = inOffset; lastByteReadInBlock += inSize; /* The lines below are a "hack" that I had to do to make dmgx work with certain dmg-files. I don't understand the issue at all, which is why this hack is here, but sometimes inOffset == 0 means that it is 0 relative to the previous partition's last inOffset. And sometimes it doesn't (meaning the actual position 0 in the dmg file). */ if(addInOffset) { if(DEBUG) println("!-----addInOffset mode: inOffset tranformation " + inOffset + "->" + (inOffset+lastInOffset)); inOffset += lastInOffset; } else if(inOffset == 0) { if(DEBUG) println("!-----Detected inOffset == 0, setting to " + lastInOffset); addInOffset = true; inOffset = lastInOffset; } outOffset += lastOutOffset; DMGBlock currentBlock = new DMGBlock(blockType, skipped, outOffset, outSize, inOffset, inSize); blocks.add(currentBlock); if(DEBUG) { println("outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize + " lastOutOffset=" + lastOutOffset + " lastInOffset=" + lastInOffset /*+ " lastInOffs=" + lastInOffs + " lastOffs=" + lastOffs*/); } if(blockType == BT_ADC) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_ADC not supported."); ++errorsReported; if(!testOnly) System.exit(0); } else if(blockType == BT_ZLIB) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZLIB processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZLIB FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); try { DMGBlockHandlers.processZlibBlock(currentBlock, dmgRaf, isoRaf, testOnly, dummyMonitor); } catch(DataFormatException dfe) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_ZLIB Could not decode..."); ++errorsReported; if(!DEBUG) { println("outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize + " lastOutOffset=" + lastOutOffset + " lastInOffset=" + lastInOffset); } dfe.printStackTrace(); if(!testOnly) System.exit(0); else { println(" Testing mode, so continuing..."); //System.exit(0); break; } } } else if(blockType == BT_BZIP2) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_BZIP2 not currently supported."); ++errorsReported; if(!testOnly) System.exit(0); } else if(blockType == BT_COPY) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_COPY processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_COPY FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } dmgRaf.seek(/*lastOffs+*/inOffset); int bytesRead = dmgRaf.read(inBuffer, 0, Math.min((int)inSize, inBuffer.length)); long totalBytesRead = bytesRead; while(bytesRead != -1) { reportFilePointerProgress(dmgRaf); if(!testOnly) isoRaf.write(inBuffer, 0, bytesRead); if(totalBytesRead >= inSize) break; bytesRead = dmgRaf.read(inBuffer, 0, Math.min((int)(inSize-totalBytesRead), inBuffer.length)); if(bytesRead > 0) totalBytesRead += bytesRead; } //lastInOffs = inOffset+inSize; } else if(blockType == BT_ZERO) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZERO processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZERO FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } reportFilePointerProgress(dmgRaf); long numberOfZeroBlocks = outSize/zeroblock.length; int numberOfRemainingBytes = (int)(outSize%zeroblock.length); for(int j = 0; j < numberOfZeroBlocks; ++j) { if(!testOnly) isoRaf.write(zeroblock); } if(!testOnly) isoRaf.write(zeroblock, 0, numberOfRemainingBytes); //lastInOffs = inOffset+inSize; } else if(blockType == BT_ZERO2) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZERO2 processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZERO2 FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } reportFilePointerProgress(dmgRaf); long numberOfZeroBlocks = outSize/zeroblock.length; int numberOfRemainingBytes = (int)(outSize%zeroblock.length); for(int j = 0; j < numberOfZeroBlocks; ++j) { if(!testOnly) isoRaf.write(zeroblock); } if(!testOnly) isoRaf.write(zeroblock, 0, numberOfRemainingBytes); //lastInOffs = inOffset+inSize; } else if(blockType == BT_UNKNOWN) { /* I have no idea what this blocktype is... but it's common, and usually doesn't appear more than 2-3 times in a dmg. As long as its input and output sizes are 0, there's no reason to complain... is there? */ if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_UNKNOWN processing..."); if(!(inSize == 0 && outSize == 0)) { println(" " + elementNumber + ":" + blockCount + ". WARNING: Blocktype BT_UNKNOWN had non-zero sizes...", " inSize=" + inSize + ", outSize=" + outSize); ++warningsReported; //println(" The author of the program would be pleased if you contacted him about this."); // ...or would I? } } else if(blockType == BT_END) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_END processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_END FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); //lastOffs += lastInOffs; lastOutOffset = outOffset; lastInOffset += lastByteReadInBlock; } else { println(" " + elementNumber + ":" + blockCount + ". WARNING: previously unseen blocktype " + blockType + " [0x" + Integer.toHexString(blockType) + "]", " " + elementNumber + ":" + blockCount + ". outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize); ++warningsReported; if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". unknown blocktype FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); } offset += 0x28; ++blockCount; } } ++elementNumber; } //printlnVerbose("Progress: 100% Done!"); reportProgress(100); String summary = (errorsReported != 0)?errorsReported+" errors reported":"No errors reported"; summary += (warningsReported != 0)?" ("+warningsReported+" warnings emitted).":"."; if(!graphical) { newline(); println(summary); printlnVerbose("Total extracted bytes: " + totalSize + " B"); } else { progmon.close(); JOptionPane.showMessageDialog(null, "Extraction complete! " + summary + "\n" + "Total extracted bytes: " + totalSize + " B", "Information", JOptionPane.INFORMATION_MESSAGE); System.exit(0); } if(!DEBUG) { if(isoRaf != null) isoRaf.close(); dmgRaf.close(); } else { if(isoRaf != null) isoRaf.close();// System.out.println("blocks.size()=" + blocks.size());// for(DMGBlock b : blocks)// System.out.println(" " + b.toString()); LinkedList<DMGBlock> merged = mergeBlocks(blocks);// System.out.println("merged.size()=" + merged.size());// for(DMGBlock b : merged)// System.out.println(" " + b.toString()); println("Extracting all the parts not containing block data from source file:"); int i = 1; DMGBlock previous = null; for(DMGBlock b : merged) { if(previous == null && b.inOffset > 0) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(0); byte[] data = new byte[(int)(b.inOffset)]; dmgRaf.read(data); curFos.write(data); curFos.close(); } else if(previous != null) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(previous.inOffset+previous.inSize); byte[] data = new byte[(int)(b.inOffset-(previous.inOffset+previous.inSize))]; dmgRaf.read(data); curFos.write(data); curFos.close(); } previous = b; } if(previous.inOffset+previous.inSize != dmgRaf.length()) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(previous.inOffset+previous.inSize); byte[] data = new byte[(int)(dmgRaf.length()-(previous.inOffset+previous.inSize))]; dmgRaf.read(data); curFos.write(data); curFos.close(); } dmgRaf.close(); System.out.println("done!"); } }
public static void notmain(String[] args) throws Exception { if(DEBUG) verbose = true; parseArgs(args); printlnVerbose("Processing: " + dmgFile); RandomAccessFile dmgRaf = new RandomAccessFile(dmgFile, "r"); RandomAccessFile isoRaf = null; boolean testOnly = false; if(isoFile != null) { isoRaf = new RandomAccessFile(isoFile, "rw"); isoRaf.setLength(0); printlnVerbose("Extracting to: " + isoFile); } else { testOnly = true; printlnVerbose("Simulating extraction..."); } dmgRaf.seek(dmgRaf.length()-PLIST_ADDRESS_1); long plistBegin1 = dmgRaf.readLong(); long plistEnd = dmgRaf.readLong(); dmgRaf.seek(dmgRaf.length()-PLIST_ADDRESS_2); long plistBegin2 = dmgRaf.readLong(); long plistSize = dmgRaf.readLong(); if(DEBUG) { println("Read addresses:", " " + plistBegin1, " " + plistBegin2); } if(plistBegin1 != plistBegin2) { println("Addresses not equal! Assumption broken... =/", plistBegin1 + " != " + plistBegin2); System.exit(0); } if(plistSize != (plistEnd-plistBegin1)) { println("plistSize field does not match plistEnd marker!", "plistSize=" + plistSize + " plistBegin1=" + plistBegin1 + " plistEnd=" + plistEnd + " plistEnd-plistBegin1=" + (plistEnd-plistBegin1)); } printlnVerbose("Jumping to address..."); dmgRaf.seek(plistBegin1); byte[] buffer = new byte[(int)plistSize]; dmgRaf.read(buffer); InputStream is = new ByteArrayInputStream(buffer); NodeBuilder handler = new NodeBuilder(); SAXParser saxParser = SAXParserFactory.newInstance().newSAXParser(); try {// System.out.println("validation: " + saxParser.getProperty("validation"));// System.out.println("external-general-entities: " + saxParser.getProperty("external-general-entities"));// System.out.println("external-parameter-entities: " + saxParser.getProperty("external-parameter-entities"));// System.out.println("is-standalone: " + saxParser.getProperty("is-standalone"));// System.out.println("lexical-handler: " + saxParser.getProperty("lexical-handler"));// System.out.println("parameter-entities: " + saxParser.getProperty("parameter-entities"));// System.out.println("namespaces: " + saxParser.getProperty("namespaces"));// System.out.println("namespace-prefixes: " + saxParser.getProperty("namespace-prefixes"));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty("")); //System.out.println("isValidating: " + saxParser.isValidating()); saxParser.parse(is, handler); } catch(SAXException se) { se.printStackTrace(); System.err.println("Could not read the partition list... exiting."); System.exit(1); } XMLNode[] rootNodes = handler.getRoots(); if(rootNodes.length != 1) { println("Could not parse DMG-file!"); System.exit(0); } /* Ok, now we have a tree built from the XML-document. Let's walk to the right place. */ /* cd plist cd dict cdkey resource-fork (type:dict) cdkey blkx (type:array) */ XMLNode current; XMLElement[] children; boolean keyFound; current = rootNodes[0]; //We are at plist... probably (there should be only one root node) current = current.cd("dict"); current = current.cdkey("resource-fork"); current = current.cdkey("blkx"); printlnVerbose("Found " + current.getChildren().length + " partitions:"); byte[] inBuffer = new byte[0x40000]; byte[] outBuffer = new byte[0x40000]; byte[] zeroblock = new byte[4096]; /* I think java always zeroes its arrays on creation... but let's play safe. */ for(int y = 0; y < zeroblock.length; ++y) zeroblock[y] = 0; LinkedList<DMGBlock> blocks = new LinkedList<DMGBlock>(); long elementNumber = 0; //long lastOffs = 0; long lastOutOffset = 0; long lastInOffset = 0; long totalSize = 0; int errorsReported = 0; int warningsReported = 0; reportProgress(0); for(XMLElement xe : current.getChildren()) { if(progmon != null && progmon.isCanceled()) System.exit(0); if(xe instanceof XMLNode) { XMLNode xn = (XMLNode)xe; byte[] data = Base64.decode(xn.getKeyValue("Data")); long partitionSize = calculatePartitionSize(data); totalSize += partitionSize; printlnVerbose(" " + xn.getKeyValue("Name")); printlnVerbose(" ID: " + xn.getKeyValue("ID")); printlnVerbose(" Attributes: " + xn.getKeyValue("Attributes")); printlnVerbose(" Partition map data length: " + data.length + " bytes"); printlnVerbose(" Partition size: " + partitionSize + " bytes"); if(verbose) { printlnVerbose(" Dumping blkx..."); FileOutputStream fos = new FileOutputStream(xn.getKeyValue("ID") + ".blkx"); fos.write(data); fos.close(); } if(DEBUG) { File dumpFile = new File("data " + xn.getKeyValue("ID") + ".bin"); println(" Dumping partition map to file: " + dumpFile); FileOutputStream dump = new FileOutputStream(dumpFile); dump.write(data); dump.close(); } int offset = 0xCC; int blockType = 0; /* Offset of the input data for the current block in the input file */ long inOffset = 0; /* Size of the input data for the current block */ long inSize = 0; /* Offset of the output data for the current block in the output file */ long outOffset = 0; /* Size of the output data (possibly larger than inSize because of decompression, zero expansion...) */ long outSize = 0; long lastByteReadInBlock = -1; boolean addInOffset = false; //, lastInOffs = 0; int blockCount = 0; while(blockType != BT_END) { if(progmon != null && progmon.isCanceled()) System.exit(0); DataInputStream dis = new DataInputStream(new ByteArrayInputStream(data)); int bytesSkipped = 0; while(bytesSkipped < offset) bytesSkipped += dis.skipBytes(offset-bytesSkipped); blockType = dis.readInt(); int skipped = dis.readInt(); //Skip 4 bytes forward outOffset = dis.readLong()*0x200;//(dis.readInt() & 0xffffffffL)*0x200; //unsigned int -> long //dis.readInt(); //Skip 4 bytes forward outSize = dis.readLong()*0x200;//(dis.readInt() & 0xffffffffL)*0x200; //unsigned int -> long inOffset = dis.readLong();// & 0xffffffffL; //unsigned int -> long //dis.readInt(); //Skip 4 bytes forward inSize = dis.readLong();//dis.readInt() & 0xffffffffL; //unsigned int -> long if(lastByteReadInBlock == -1) lastByteReadInBlock = inOffset; lastByteReadInBlock += inSize; /* The lines below are a "hack" that I had to do to make dmgx work with certain dmg-files. I don't understand the issue at all, which is why this hack is here, but sometimes inOffset == 0 means that it is 0 relative to the previous partition's last inOffset. And sometimes it doesn't (meaning the actual position 0 in the dmg file). */ if(addInOffset) { if(DEBUG) println("!-----addInOffset mode: inOffset tranformation " + inOffset + "->" + (inOffset+lastInOffset)); inOffset += lastInOffset; } else if(inOffset == 0) { if(DEBUG) println("!-----Detected inOffset == 0, setting to " + lastInOffset); addInOffset = true; inOffset = lastInOffset; } outOffset += lastOutOffset; DMGBlock currentBlock = new DMGBlock(blockType, skipped, outOffset, outSize, inOffset, inSize); blocks.add(currentBlock); if(DEBUG) { println("outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize + " lastOutOffset=" + lastOutOffset + " lastInOffset=" + lastInOffset /*+ " lastInOffs=" + lastInOffs + " lastOffs=" + lastOffs*/); } if(blockType == BT_ADC) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_ADC not supported."); ++errorsReported; if(!testOnly) System.exit(0); } else if(blockType == BT_ZLIB) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZLIB processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZLIB FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); try { DMGBlockHandlers.processZlibBlock(currentBlock, dmgRaf, isoRaf, testOnly, dummyMonitor); } catch(DataFormatException dfe) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_ZLIB Could not decode..."); ++errorsReported; if(!DEBUG) { println("outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize + " lastOutOffset=" + lastOutOffset + " lastInOffset=" + lastInOffset); } dfe.printStackTrace(); if(!testOnly) System.exit(0); else { println(" Testing mode, so continuing..."); //System.exit(0); break; } } } else if(blockType == BT_BZIP2) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_BZIP2 not currently supported."); ++errorsReported; if(!testOnly) System.exit(0); } else if(blockType == BT_COPY) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_COPY processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_COPY FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } dmgRaf.seek(/*lastOffs+*/inOffset); int bytesRead = dmgRaf.read(inBuffer, 0, Math.min((int)inSize, inBuffer.length)); long totalBytesRead = bytesRead; while(bytesRead != -1) { reportFilePointerProgress(dmgRaf); if(!testOnly) isoRaf.write(inBuffer, 0, bytesRead); if(totalBytesRead >= inSize) break; bytesRead = dmgRaf.read(inBuffer, 0, Math.min((int)(inSize-totalBytesRead), inBuffer.length)); if(bytesRead > 0) totalBytesRead += bytesRead; } //lastInOffs = inOffset+inSize; } else if(blockType == BT_ZERO) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZERO processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZERO FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } reportFilePointerProgress(dmgRaf); long numberOfZeroBlocks = outSize/zeroblock.length; int numberOfRemainingBytes = (int)(outSize%zeroblock.length); for(int j = 0; j < numberOfZeroBlocks; ++j) { if(!testOnly) isoRaf.write(zeroblock); } if(!testOnly) isoRaf.write(zeroblock, 0, numberOfRemainingBytes); //lastInOffs = inOffset+inSize; } else if(blockType == BT_ZERO2) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZERO2 processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZERO2 FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } reportFilePointerProgress(dmgRaf); long numberOfZeroBlocks = outSize/zeroblock.length; int numberOfRemainingBytes = (int)(outSize%zeroblock.length); for(int j = 0; j < numberOfZeroBlocks; ++j) { if(!testOnly) isoRaf.write(zeroblock); } if(!testOnly) isoRaf.write(zeroblock, 0, numberOfRemainingBytes); //lastInOffs = inOffset+inSize; } else if(blockType == BT_UNKNOWN) { /* I have no idea what this blocktype is... but it's common, and usually doesn't appear more than 2-3 times in a dmg. As long as its input and output sizes are 0, there's no reason to complain... is there? */ if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_UNKNOWN processing..."); if(!(inSize == 0 && outSize == 0)) { println(" " + elementNumber + ":" + blockCount + ". WARNING: Blocktype BT_UNKNOWN had non-zero sizes...", " inSize=" + inSize + ", outSize=" + outSize); ++warningsReported; //println(" The author of the program would be pleased if you contacted him about this."); // ...or would I? } } else if(blockType == BT_END) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_END processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_END FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); //lastOffs += lastInOffs; lastOutOffset = outOffset; lastInOffset += lastByteReadInBlock; } else { println(" " + elementNumber + ":" + blockCount + ". WARNING: previously unseen blocktype " + blockType + " [0x" + Integer.toHexString(blockType) + "]", " " + elementNumber + ":" + blockCount + ". outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize); ++warningsReported; if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". unknown blocktype FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); } offset += 0x28; ++blockCount; } } ++elementNumber; } //printlnVerbose("Progress: 100% Done!"); reportProgress(100); String summary = (errorsReported != 0)?errorsReported+" errors reported":"No errors reported"; summary += (warningsReported != 0)?" ("+warningsReported+" warnings emitted).":"."; if(!graphical) { newline(); println(summary); printlnVerbose("Total extracted bytes: " + totalSize + " B"); } else { progmon.close(); JOptionPane.showMessageDialog(null, "Extraction complete! " + summary + "\n" + "Total extracted bytes: " + totalSize + " B", "Information", JOptionPane.INFORMATION_MESSAGE); System.exit(0); } if(!DEBUG) { if(isoRaf != null) isoRaf.close(); dmgRaf.close(); } else { if(isoRaf != null) isoRaf.close();// System.out.println("blocks.size()=" + blocks.size());// for(DMGBlock b : blocks)// System.out.println(" " + b.toString()); LinkedList<DMGBlock> merged = mergeBlocks(blocks);// System.out.println("merged.size()=" + merged.size());// for(DMGBlock b : merged)// System.out.println(" " + b.toString()); println("Extracting all the parts not containing block data from source file:"); int i = 1; DMGBlock previous = null; for(DMGBlock b : merged) { if(previous == null && b.inOffset > 0) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(0); byte[] data = new byte[(int)(b.inOffset)]; dmgRaf.read(data); curFos.write(data); curFos.close(); } else if(previous != null) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(previous.inOffset+previous.inSize); byte[] data = new byte[(int)(b.inOffset-(previous.inOffset+previous.inSize))]; dmgRaf.read(data); curFos.write(data); curFos.close(); } previous = b; } if(previous.inOffset+previous.inSize != dmgRaf.length()) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(previous.inOffset+previous.inSize); byte[] data = new byte[(int)(dmgRaf.length()-(previous.inOffset+previous.inSize))]; dmgRaf.read(data); curFos.write(data); curFos.close(); } dmgRaf.close(); System.out.println("done!"); } }
1,114,674
public static void notmain(String[] args) throws Exception { if(DEBUG) verbose = true; parseArgs(args); printlnVerbose("Processing: " + dmgFile); RandomAccessFile dmgRaf = new RandomAccessFile(dmgFile, "r"); RandomAccessFile isoRaf = null; boolean testOnly = false; if(isoFile != null) { isoRaf = new RandomAccessFile(isoFile, "rw"); isoRaf.setLength(0); printlnVerbose("Extracting to: " + isoFile); } else { testOnly = true; printlnVerbose("Simulating extraction..."); } dmgRaf.seek(dmgRaf.length()-PLIST_ADDRESS_1); long plistBegin1 = dmgRaf.readLong(); long plistEnd = dmgRaf.readLong(); dmgRaf.seek(dmgRaf.length()-PLIST_ADDRESS_2); long plistBegin2 = dmgRaf.readLong(); long plistSize = dmgRaf.readLong(); if(DEBUG) { println("Read addresses:", " " + plistBegin1, " " + plistBegin2); } if(plistBegin1 != plistBegin2) { println("Addresses not equal! Assumption broken... =/", plistBegin1 + " != " + plistBegin2); System.exit(0); } if(plistSize != (plistEnd-plistBegin1)) { println("plistSize field does not match plistEnd marker!", "plistSize=" + plistSize + " plistBegin1=" + plistBegin1 + " plistEnd=" + plistEnd + " plistEnd-plistBegin1=" + (plistEnd-plistBegin1)); } printlnVerbose("Jumping to address..."); dmgRaf.seek(plistBegin1); byte[] buffer = new byte[(int)plistSize]; dmgRaf.read(buffer); InputStream is = new ByteArrayInputStream(buffer); NodeBuilder handler = new NodeBuilder(); SAXParser saxParser = SAXParserFactory.newInstance().newSAXParser(); try {// System.out.println("validation: " + saxParser.getProperty("validation"));// System.out.println("external-general-entities: " + saxParser.getProperty("external-general-entities"));// System.out.println("external-parameter-entities: " + saxParser.getProperty("external-parameter-entities"));// System.out.println("is-standalone: " + saxParser.getProperty("is-standalone"));// System.out.println("lexical-handler: " + saxParser.getProperty("lexical-handler"));// System.out.println("parameter-entities: " + saxParser.getProperty("parameter-entities"));// System.out.println("namespaces: " + saxParser.getProperty("namespaces"));// System.out.println("namespace-prefixes: " + saxParser.getProperty("namespace-prefixes"));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty("")); //System.out.println("isValidating: " + saxParser.isValidating()); saxParser.parse(is, handler); } catch(SAXException se) { se.printStackTrace(); System.err.println("Could not read the partition list... exiting."); System.exit(1); } XMLNode[] rootNodes = handler.getRoots(); if(rootNodes.length != 1) { println("Could not parse DMG-file!"); System.exit(0); } /* Ok, now we have a tree built from the XML-document. Let's walk to the right place. */ /* cd plist cd dict cdkey resource-fork (type:dict) cdkey blkx (type:array) */ XMLNode current; XMLElement[] children; boolean keyFound; current = rootNodes[0]; //We are at plist... probably (there should be only one root node) current = current.cd("dict"); current = current.cdkey("resource-fork"); current = current.cdkey("blkx"); printlnVerbose("Found " + current.getChildren().length + " partitions:"); byte[] inBuffer = new byte[0x40000]; byte[] outBuffer = new byte[0x40000]; byte[] zeroblock = new byte[4096]; /* I think java always zeroes its arrays on creation... but let's play safe. */ for(int y = 0; y < zeroblock.length; ++y) zeroblock[y] = 0; LinkedList<DMGBlock> blocks = new LinkedList<DMGBlock>(); long elementNumber = 0; //long lastOffs = 0; long lastOutOffset = 0; long lastInOffset = 0; long totalSize = 0; int errorsReported = 0; int warningsReported = 0; reportProgress(0); for(XMLElement xe : current.getChildren()) { if(progmon != null && progmon.isCanceled()) System.exit(0); if(xe instanceof XMLNode) { XMLNode xn = (XMLNode)xe; byte[] data = Base64.decode(xn.getKeyValue("Data")); long partitionSize = calculatePartitionSize(data); totalSize += partitionSize; printlnVerbose(" " + xn.getKeyValue("Name")); printlnVerbose(" ID: " + xn.getKeyValue("ID")); printlnVerbose(" Attributes: " + xn.getKeyValue("Attributes")); printlnVerbose(" Partition map data length: " + data.length + " bytes"); printlnVerbose(" Partition size: " + partitionSize + " bytes"); if(verbose) { printlnVerbose(" Dumping blkx..."); FileOutputStream fos = new FileOutputStream(xn.getKeyValue("ID") + ".blkx"); fos.write(data); fos.close(); } if(DEBUG) { File dumpFile = new File("data " + xn.getKeyValue("ID") + ".bin"); println(" Dumping partition map to file: " + dumpFile); FileOutputStream dump = new FileOutputStream(dumpFile); dump.write(data); dump.close(); } int offset = 0xCC; int blockType = 0; /* Offset of the input data for the current block in the input file */ long inOffset = 0; /* Size of the input data for the current block */ long inSize = 0; /* Offset of the output data for the current block in the output file */ long outOffset = 0; /* Size of the output data (possibly larger than inSize because of decompression, zero expansion...) */ long outSize = 0; long lastByteReadInBlock = -1; boolean addInOffset = false; //, lastInOffs = 0; int blockCount = 0; while(blockType != BT_END) { if(progmon != null && progmon.isCanceled()) System.exit(0); DataInputStream dis = new DataInputStream(new ByteArrayInputStream(data)); int bytesSkipped = 0; while(bytesSkipped < offset) bytesSkipped += dis.skipBytes(offset-bytesSkipped); blockType = dis.readInt(); int skipped = dis.readInt(); //Skip 4 bytes forward outOffset = dis.readLong()*0x200;//(dis.readInt() & 0xffffffffL)*0x200; //unsigned int -> long //dis.readInt(); //Skip 4 bytes forward outSize = dis.readLong()*0x200;//(dis.readInt() & 0xffffffffL)*0x200; //unsigned int -> long inOffset = dis.readLong();// & 0xffffffffL; //unsigned int -> long //dis.readInt(); //Skip 4 bytes forward inSize = dis.readLong();//dis.readInt() & 0xffffffffL; //unsigned int -> long if(lastByteReadInBlock == -1) lastByteReadInBlock = inOffset; lastByteReadInBlock += inSize; /* The lines below are a "hack" that I had to do to make dmgx work with certain dmg-files. I don't understand the issue at all, which is why this hack is here, but sometimes inOffset == 0 means that it is 0 relative to the previous partition's last inOffset. And sometimes it doesn't (meaning the actual position 0 in the dmg file). */ if(addInOffset) { if(DEBUG) println("!-----addInOffset mode: inOffset tranformation " + inOffset + "->" + (inOffset+lastInOffset)); inOffset += lastInOffset; } else if(inOffset == 0) { if(DEBUG) println("!-----Detected inOffset == 0, setting to " + lastInOffset); addInOffset = true; inOffset = lastInOffset; } outOffset += lastOutOffset; DMGBlock currentBlock = new DMGBlock(blockType, skipped, outOffset, outSize, inOffset, inSize); blocks.add(currentBlock); if(DEBUG) { println("outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize + " lastOutOffset=" + lastOutOffset + " lastInOffset=" + lastInOffset /*+ " lastInOffs=" + lastInOffs + " lastOffs=" + lastOffs*/); } if(blockType == BT_ADC) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_ADC not supported."); ++errorsReported; if(!testOnly) System.exit(0); } else if(blockType == BT_ZLIB) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZLIB processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZLIB FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); try { DMGBlockHandlers.processZlibBlock(currentBlock, dmgRaf, isoRaf, testOnly, dummyMonitor); } catch(DataFormatException dfe) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_ZLIB Could not decode..."); ++errorsReported; if(!DEBUG) { println("outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize + " lastOutOffset=" + lastOutOffset + " lastInOffset=" + lastInOffset); } dfe.printStackTrace(); if(!testOnly) System.exit(0); else { println(" Testing mode, so continuing..."); //System.exit(0); break; } } } else if(blockType == BT_BZIP2) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_BZIP2 not currently supported."); ++errorsReported; if(!testOnly) System.exit(0); } else if(blockType == BT_COPY) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_COPY processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_COPY FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } dmgRaf.seek(/*lastOffs+*/inOffset); int bytesRead = dmgRaf.read(inBuffer, 0, Math.min((int)inSize, inBuffer.length)); long totalBytesRead = bytesRead; while(bytesRead != -1) { reportFilePointerProgress(dmgRaf); if(!testOnly) isoRaf.write(inBuffer, 0, bytesRead); if(totalBytesRead >= inSize) break; bytesRead = dmgRaf.read(inBuffer, 0, Math.min((int)(inSize-totalBytesRead), inBuffer.length)); if(bytesRead > 0) totalBytesRead += bytesRead; } //lastInOffs = inOffset+inSize; } else if(blockType == BT_ZERO) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZERO processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZERO FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } reportFilePointerProgress(dmgRaf); long numberOfZeroBlocks = outSize/zeroblock.length; int numberOfRemainingBytes = (int)(outSize%zeroblock.length); for(int j = 0; j < numberOfZeroBlocks; ++j) { if(!testOnly) isoRaf.write(zeroblock); } if(!testOnly) isoRaf.write(zeroblock, 0, numberOfRemainingBytes); //lastInOffs = inOffset+inSize; } else if(blockType == BT_ZERO2) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZERO2 processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZERO2 FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } reportFilePointerProgress(dmgRaf); long numberOfZeroBlocks = outSize/zeroblock.length; int numberOfRemainingBytes = (int)(outSize%zeroblock.length); for(int j = 0; j < numberOfZeroBlocks; ++j) { if(!testOnly) isoRaf.write(zeroblock); } if(!testOnly) isoRaf.write(zeroblock, 0, numberOfRemainingBytes); //lastInOffs = inOffset+inSize; } else if(blockType == BT_UNKNOWN) { /* I have no idea what this blocktype is... but it's common, and usually doesn't appear more than 2-3 times in a dmg. As long as its input and output sizes are 0, there's no reason to complain... is there? */ if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_UNKNOWN processing..."); if(!(inSize == 0 && outSize == 0)) { println(" " + elementNumber + ":" + blockCount + ". WARNING: Blocktype BT_UNKNOWN had non-zero sizes...", " inSize=" + inSize + ", outSize=" + outSize); ++warningsReported; //println(" The author of the program would be pleased if you contacted him about this."); // ...or would I? } } else if(blockType == BT_END) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_END processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_END FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); //lastOffs += lastInOffs; lastOutOffset = outOffset; lastInOffset += lastByteReadInBlock; } else { println(" " + elementNumber + ":" + blockCount + ". WARNING: previously unseen blocktype " + blockType + " [0x" + Integer.toHexString(blockType) + "]", " " + elementNumber + ":" + blockCount + ". outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize); ++warningsReported; if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". unknown blocktype FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); } offset += 0x28; ++blockCount; } } ++elementNumber; } //printlnVerbose("Progress: 100% Done!"); reportProgress(100); String summary = (errorsReported != 0)?errorsReported+" errors reported":"No errors reported"; summary += (warningsReported != 0)?" ("+warningsReported+" warnings emitted).":"."; if(!graphical) { newline(); println(summary); printlnVerbose("Total extracted bytes: " + totalSize + " B"); } else { progmon.close(); JOptionPane.showMessageDialog(null, "Extraction complete! " + summary + "\n" + "Total extracted bytes: " + totalSize + " B", "Information", JOptionPane.INFORMATION_MESSAGE); System.exit(0); } if(!DEBUG) { if(isoRaf != null) isoRaf.close(); dmgRaf.close(); } else { if(isoRaf != null) isoRaf.close();// System.out.println("blocks.size()=" + blocks.size());// for(DMGBlock b : blocks)// System.out.println(" " + b.toString()); LinkedList<DMGBlock> merged = mergeBlocks(blocks);// System.out.println("merged.size()=" + merged.size());// for(DMGBlock b : merged)// System.out.println(" " + b.toString()); println("Extracting all the parts not containing block data from source file:"); int i = 1; DMGBlock previous = null; for(DMGBlock b : merged) { if(previous == null && b.inOffset > 0) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(0); byte[] data = new byte[(int)(b.inOffset)]; dmgRaf.read(data); curFos.write(data); curFos.close(); } else if(previous != null) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(previous.inOffset+previous.inSize); byte[] data = new byte[(int)(b.inOffset-(previous.inOffset+previous.inSize))]; dmgRaf.read(data); curFos.write(data); curFos.close(); } previous = b; } if(previous.inOffset+previous.inSize != dmgRaf.length()) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(previous.inOffset+previous.inSize); byte[] data = new byte[(int)(dmgRaf.length()-(previous.inOffset+previous.inSize))]; dmgRaf.read(data); curFos.write(data); curFos.close(); } dmgRaf.close(); System.out.println("done!"); } }
public static void notmain(String[] args) throws Exception { if(DEBUG) verbose = true; parseArgs(args); printlnVerbose("Processing: " + dmgFile); RandomAccessFile dmgRaf = new RandomAccessFile(dmgFile, "r"); RandomAccessFile isoRaf = null; boolean testOnly = false; if(isoFile != null) { isoRaf = new RandomAccessFile(isoFile, "rw"); isoRaf.setLength(0); printlnVerbose("Extracting to: " + isoFile); } else { testOnly = true; printlnVerbose("Simulating extraction..."); } dmgRaf.seek(dmgRaf.length()-PLIST_ADDRESS_1); long plistBegin1 = dmgRaf.readLong(); long plistEnd = dmgRaf.readLong(); dmgRaf.seek(dmgRaf.length()-PLIST_ADDRESS_2); long plistBegin2 = dmgRaf.readLong(); long plistSize = dmgRaf.readLong(); if(DEBUG) { println("Read addresses:", " " + plistBegin1, " " + plistBegin2); } if(plistBegin1 != plistBegin2) { println("Addresses not equal! Assumption broken... =/", plistBegin1 + " != " + plistBegin2); System.exit(0); } if(plistSize != (plistEnd-plistBegin1)) { println("plistSize field does not match plistEnd marker!", "plistSize=" + plistSize + " plistBegin1=" + plistBegin1 + " plistEnd=" + plistEnd + " plistEnd-plistBegin1=" + (plistEnd-plistBegin1)); } printlnVerbose("Jumping to address..."); dmgRaf.seek(plistBegin1); byte[] buffer = new byte[(int)plistSize]; dmgRaf.read(buffer); InputStream is = new ByteArrayInputStream(buffer); NodeBuilder handler = new NodeBuilder(); SAXParser saxParser = SAXParserFactory.newInstance().newSAXParser(); try {// System.out.println("validation: " + saxParser.getProperty("validation"));// System.out.println("external-general-entities: " + saxParser.getProperty("external-general-entities"));// System.out.println("external-parameter-entities: " + saxParser.getProperty("external-parameter-entities"));// System.out.println("is-standalone: " + saxParser.getProperty("is-standalone"));// System.out.println("lexical-handler: " + saxParser.getProperty("lexical-handler"));// System.out.println("parameter-entities: " + saxParser.getProperty("parameter-entities"));// System.out.println("namespaces: " + saxParser.getProperty("namespaces"));// System.out.println("namespace-prefixes: " + saxParser.getProperty("namespace-prefixes"));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty("")); //System.out.println("isValidating: " + saxParser.isValidating()); saxParser.parse(is, handler); } catch(SAXException se) { se.printStackTrace(); System.err.println("Could not read the partition list... exiting."); System.exit(1); } XMLNode[] rootNodes = handler.getRoots(); if(rootNodes.length != 1) { println("Could not parse DMG-file!"); System.exit(0); } /* Ok, now we have a tree built from the XML-document. Let's walk to the right place. */ /* cd plist cd dict cdkey resource-fork (type:dict) cdkey blkx (type:array) */ XMLNode current; XMLElement[] children; boolean keyFound; current = rootNodes[0]; //We are at plist... probably (there should be only one root node) current = current.cd("dict"); current = current.cdkey("resource-fork"); current = current.cdkey("blkx"); printlnVerbose("Found " + current.getChildren().length + " partitions:"); byte[] inBuffer = new byte[0x40000]; byte[] outBuffer = new byte[0x40000]; byte[] zeroblock = new byte[4096]; /* I think java always zeroes its arrays on creation... but let's play safe. */ for(int y = 0; y < zeroblock.length; ++y) zeroblock[y] = 0; LinkedList<DMGBlock> blocks = new LinkedList<DMGBlock>(); long elementNumber = 0; //long lastOffs = 0; long lastOutOffset = 0; long lastInOffset = 0; long totalSize = 0; int errorsReported = 0; int warningsReported = 0; reportProgress(0); for(XMLElement xe : current.getChildren()) { if(progmon != null && progmon.isCanceled()) System.exit(0); if(xe instanceof XMLNode) { XMLNode xn = (XMLNode)xe; byte[] data = Base64.decode(xn.getKeyValue("Data")); long partitionSize = calculatePartitionSize(data); totalSize += partitionSize; printlnVerbose(" " + xn.getKeyValue("Name")); printlnVerbose(" ID: " + xn.getKeyValue("ID")); printlnVerbose(" Attributes: " + xn.getKeyValue("Attributes")); printlnVerbose(" Partition map data length: " + data.length + " bytes"); printlnVerbose(" Partition size: " + partitionSize + " bytes"); if(verbose) { printlnVerbose(" Dumping blkx..."); FileOutputStream fos = new FileOutputStream(xn.getKeyValue("ID") + ".blkx"); fos.write(data); fos.close(); } if(DEBUG) { File dumpFile = new File("data " + xn.getKeyValue("ID") + ".bin"); println(" Dumping partition map to file: " + dumpFile); FileOutputStream dump = new FileOutputStream(dumpFile); dump.write(data); dump.close(); } int offset = 0xCC; int blockType = 0; /* Offset of the input data for the current block in the input file */ long inOffset = 0; /* Size of the input data for the current block */ long inSize = 0; /* Offset of the output data for the current block in the output file */ long outOffset = 0; /* Size of the output data (possibly larger than inSize because of decompression, zero expansion...) */ long outSize = 0; long lastByteReadInBlock = -1; boolean addInOffset = false; //, lastInOffs = 0; int blockCount = 0; while(blockType != BT_END) { if(progmon != null && progmon.isCanceled()) System.exit(0); DataInputStream dis = new DataInputStream(new ByteArrayInputStream(data)); int bytesSkipped = 0; while(bytesSkipped < offset) bytesSkipped += dis.skipBytes(offset-bytesSkipped); blockType = dis.readInt(); int skipped = dis.readInt(); //Skip 4 bytes forward outOffset = dis.readLong()*0x200;//(dis.readInt() & 0xffffffffL)*0x200; //unsigned int -> long //dis.readInt(); //Skip 4 bytes forward outSize = dis.readLong()*0x200;//(dis.readInt() & 0xffffffffL)*0x200; //unsigned int -> long inOffset = dis.readLong();// & 0xffffffffL; //unsigned int -> long //dis.readInt(); //Skip 4 bytes forward inSize = dis.readLong();//dis.readInt() & 0xffffffffL; //unsigned int -> long if(lastByteReadInBlock == -1) lastByteReadInBlock = inOffset; lastByteReadInBlock += inSize; /* The lines below are a "hack" that I had to do to make dmgx work with certain dmg-files. I don't understand the issue at all, which is why this hack is here, but sometimes inOffset == 0 means that it is 0 relative to the previous partition's last inOffset. And sometimes it doesn't (meaning the actual position 0 in the dmg file). */ if(addInOffset) { if(DEBUG) println("!-----addInOffset mode: inOffset tranformation " + inOffset + "->" + (inOffset+lastInOffset)); inOffset += lastInOffset; } else if(inOffset == 0) { if(DEBUG) println("!-----Detected inOffset == 0, setting to " + lastInOffset); addInOffset = true; inOffset = lastInOffset; } outOffset += lastOutOffset; DMGBlock currentBlock = new DMGBlock(blockType, skipped, outOffset, outSize, inOffset, inSize); blocks.add(currentBlock); if(DEBUG) { println("outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize + " lastOutOffset=" + lastOutOffset + " lastInOffset=" + lastInOffset /*+ " lastInOffs=" + lastInOffs + " lastOffs=" + lastOffs*/); } if(blockType == BT_ADC) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_ADC not supported."); ++errorsReported; if(!testOnly) System.exit(0); } else if(blockType == BT_ZLIB) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZLIB processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZLIB FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); try { DMGBlockHandlers.processZlibBlock(currentBlock, dmgRaf, isoRaf, testOnly, dummyMonitor); } catch(DataFormatException dfe) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_ZLIB Could not decode..."); ++errorsReported; if(!DEBUG) { println("outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize + " lastOutOffset=" + lastOutOffset + " lastInOffset=" + lastInOffset); } dfe.printStackTrace(); if(!testOnly) System.exit(0); else { println(" Testing mode, so continuing..."); //System.exit(0); break; } } } else if(blockType == BT_BZIP2) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_BZIP2 not currently supported."); ++errorsReported; if(!testOnly) System.exit(0); } else if(blockType == BT_COPY) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_COPY processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_COPY FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } dmgRaf.seek(/*lastOffs+*/inOffset); int bytesRead = dmgRaf.read(inBuffer, 0, Math.min((int)inSize, inBuffer.length)); long totalBytesRead = bytesRead; while(bytesRead != -1) { reportFilePointerProgress(dmgRaf); if(!testOnly) isoRaf.write(inBuffer, 0, bytesRead); if(totalBytesRead >= inSize) break; bytesRead = dmgRaf.read(inBuffer, 0, Math.min((int)(inSize-totalBytesRead), inBuffer.length)); if(bytesRead > 0) totalBytesRead += bytesRead; } //lastInOffs = inOffset+inSize; } else if(blockType == BT_ZERO) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZERO processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZERO FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } reportFilePointerProgress(dmgRaf); long numberOfZeroBlocks = outSize/zeroblock.length; int numberOfRemainingBytes = (int)(outSize%zeroblock.length); for(int j = 0; j < numberOfZeroBlocks; ++j) { if(!testOnly) isoRaf.write(zeroblock); } if(!testOnly) isoRaf.write(zeroblock, 0, numberOfRemainingBytes); //lastInOffs = inOffset+inSize; } else if(blockType == BT_ZERO2) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZERO2 processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZERO2 FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } reportFilePointerProgress(dmgRaf); long numberOfZeroBlocks = outSize/zeroblock.length; int numberOfRemainingBytes = (int)(outSize%zeroblock.length); for(int j = 0; j < numberOfZeroBlocks; ++j) { if(!testOnly) isoRaf.write(zeroblock); } if(!testOnly) isoRaf.write(zeroblock, 0, numberOfRemainingBytes); //lastInOffs = inOffset+inSize; } else if(blockType == BT_UNKNOWN) { /* I have no idea what this blocktype is... but it's common, and usually doesn't appear more than 2-3 times in a dmg. As long as its input and output sizes are 0, there's no reason to complain... is there? */ if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_UNKNOWN processing..."); if(!(inSize == 0 && outSize == 0)) { println(" " + elementNumber + ":" + blockCount + ". WARNING: Blocktype BT_UNKNOWN had non-zero sizes...", " inSize=" + inSize + ", outSize=" + outSize); ++warningsReported; //println(" The author of the program would be pleased if you contacted him about this."); // ...or would I? } } else if(blockType == BT_END) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_END processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_END FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); //lastOffs += lastInOffs; lastOutOffset = outOffset; lastInOffset += lastByteReadInBlock; } else { println(" " + elementNumber + ":" + blockCount + ". WARNING: previously unseen blocktype " + blockType + " [0x" + Integer.toHexString(blockType) + "]", " " + elementNumber + ":" + blockCount + ". outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize); ++warningsReported; if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". unknown blocktype FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); } offset += 0x28; ++blockCount; } } ++elementNumber; } //printlnVerbose("Progress: 100% Done!"); reportProgress(100); String summary = (errorsReported != 0)?errorsReported+" errors reported":"No errors reported"; summary += (warningsReported != 0)?" ("+warningsReported+" warnings emitted).":"."; if(!graphical) { newline(); println(summary); printlnVerbose("Total extracted bytes: " + totalSize + " B"); } else { progmon.close(); JOptionPane.showMessageDialog(null, "Extraction complete! " + summary + "\n" + "Total extracted bytes: " + totalSize + " B", "Information", JOptionPane.INFORMATION_MESSAGE); System.exit(0); } if(!DEBUG) { if(isoRaf != null) isoRaf.close(); dmgRaf.close(); } else { if(isoRaf != null) isoRaf.close();// System.out.println("blocks.size()=" + blocks.size());// for(DMGBlock b : blocks)// System.out.println(" " + b.toString()); LinkedList<DMGBlock> merged = mergeBlocks(blocks);// System.out.println("merged.size()=" + merged.size());// for(DMGBlock b : merged)// System.out.println(" " + b.toString()); println("Extracting all the parts not containing block data from source file:"); int i = 1; DMGBlock previous = null; for(DMGBlock b : merged) { if(previous == null && b.inOffset > 0) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(0); byte[] data = new byte[(int)(b.inOffset)]; dmgRaf.read(data); curFos.write(data); curFos.close(); } else if(previous != null) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(previous.inOffset+previous.inSize); byte[] data = new byte[(int)(b.inOffset-(previous.inOffset+previous.inSize))]; dmgRaf.read(data); curFos.write(data); curFos.close(); } previous = b; } if(previous.inOffset+previous.inSize != dmgRaf.length()) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(previous.inOffset+previous.inSize); byte[] data = new byte[(int)(dmgRaf.length()-(previous.inOffset+previous.inSize))]; dmgRaf.read(data); curFos.write(data); curFos.close(); } dmgRaf.close(); System.out.println("done!"); } }
1,114,675
public static void notmain(String[] args) throws Exception { if(DEBUG) verbose = true; parseArgs(args); printlnVerbose("Processing: " + dmgFile); RandomAccessFile dmgRaf = new RandomAccessFile(dmgFile, "r"); RandomAccessFile isoRaf = null; boolean testOnly = false; if(isoFile != null) { isoRaf = new RandomAccessFile(isoFile, "rw"); isoRaf.setLength(0); printlnVerbose("Extracting to: " + isoFile); } else { testOnly = true; printlnVerbose("Simulating extraction..."); } dmgRaf.seek(dmgRaf.length()-PLIST_ADDRESS_1); long plistBegin1 = dmgRaf.readLong(); long plistEnd = dmgRaf.readLong(); dmgRaf.seek(dmgRaf.length()-PLIST_ADDRESS_2); long plistBegin2 = dmgRaf.readLong(); long plistSize = dmgRaf.readLong(); if(DEBUG) { println("Read addresses:", " " + plistBegin1, " " + plistBegin2); } if(plistBegin1 != plistBegin2) { println("Addresses not equal! Assumption broken... =/", plistBegin1 + " != " + plistBegin2); System.exit(0); } if(plistSize != (plistEnd-plistBegin1)) { println("plistSize field does not match plistEnd marker!", "plistSize=" + plistSize + " plistBegin1=" + plistBegin1 + " plistEnd=" + plistEnd + " plistEnd-plistBegin1=" + (plistEnd-plistBegin1)); } printlnVerbose("Jumping to address..."); dmgRaf.seek(plistBegin1); byte[] buffer = new byte[(int)plistSize]; dmgRaf.read(buffer); InputStream is = new ByteArrayInputStream(buffer); NodeBuilder handler = new NodeBuilder(); SAXParser saxParser = SAXParserFactory.newInstance().newSAXParser(); try {// System.out.println("validation: " + saxParser.getProperty("validation"));// System.out.println("external-general-entities: " + saxParser.getProperty("external-general-entities"));// System.out.println("external-parameter-entities: " + saxParser.getProperty("external-parameter-entities"));// System.out.println("is-standalone: " + saxParser.getProperty("is-standalone"));// System.out.println("lexical-handler: " + saxParser.getProperty("lexical-handler"));// System.out.println("parameter-entities: " + saxParser.getProperty("parameter-entities"));// System.out.println("namespaces: " + saxParser.getProperty("namespaces"));// System.out.println("namespace-prefixes: " + saxParser.getProperty("namespace-prefixes"));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty("")); //System.out.println("isValidating: " + saxParser.isValidating()); saxParser.parse(is, handler); } catch(SAXException se) { se.printStackTrace(); System.err.println("Could not read the partition list... exiting."); System.exit(1); } XMLNode[] rootNodes = handler.getRoots(); if(rootNodes.length != 1) { println("Could not parse DMG-file!"); System.exit(0); } /* Ok, now we have a tree built from the XML-document. Let's walk to the right place. */ /* cd plist cd dict cdkey resource-fork (type:dict) cdkey blkx (type:array) */ XMLNode current; XMLElement[] children; boolean keyFound; current = rootNodes[0]; //We are at plist... probably (there should be only one root node) current = current.cd("dict"); current = current.cdkey("resource-fork"); current = current.cdkey("blkx"); printlnVerbose("Found " + current.getChildren().length + " partitions:"); byte[] inBuffer = new byte[0x40000]; byte[] outBuffer = new byte[0x40000]; byte[] zeroblock = new byte[4096]; /* I think java always zeroes its arrays on creation... but let's play safe. */ for(int y = 0; y < zeroblock.length; ++y) zeroblock[y] = 0; LinkedList<DMGBlock> blocks = new LinkedList<DMGBlock>(); long elementNumber = 0; //long lastOffs = 0; long lastOutOffset = 0; long lastInOffset = 0; long totalSize = 0; int errorsReported = 0; int warningsReported = 0; reportProgress(0); for(XMLElement xe : current.getChildren()) { if(progmon != null && progmon.isCanceled()) System.exit(0); if(xe instanceof XMLNode) { XMLNode xn = (XMLNode)xe; byte[] data = Base64.decode(xn.getKeyValue("Data")); long partitionSize = calculatePartitionSize(data); totalSize += partitionSize; printlnVerbose(" " + xn.getKeyValue("Name")); printlnVerbose(" ID: " + xn.getKeyValue("ID")); printlnVerbose(" Attributes: " + xn.getKeyValue("Attributes")); printlnVerbose(" Partition map data length: " + data.length + " bytes"); printlnVerbose(" Partition size: " + partitionSize + " bytes"); if(verbose) { printlnVerbose(" Dumping blkx..."); FileOutputStream fos = new FileOutputStream(xn.getKeyValue("ID") + ".blkx"); fos.write(data); fos.close(); } if(DEBUG) { File dumpFile = new File("data " + xn.getKeyValue("ID") + ".bin"); println(" Dumping partition map to file: " + dumpFile); FileOutputStream dump = new FileOutputStream(dumpFile); dump.write(data); dump.close(); } int offset = 0xCC; int blockType = 0; /* Offset of the input data for the current block in the input file */ long inOffset = 0; /* Size of the input data for the current block */ long inSize = 0; /* Offset of the output data for the current block in the output file */ long outOffset = 0; /* Size of the output data (possibly larger than inSize because of decompression, zero expansion...) */ long outSize = 0; long lastByteReadInBlock = -1; boolean addInOffset = false; //, lastInOffs = 0; int blockCount = 0; while(blockType != BT_END) { if(progmon != null && progmon.isCanceled()) System.exit(0); DataInputStream dis = new DataInputStream(new ByteArrayInputStream(data)); int bytesSkipped = 0; while(bytesSkipped < offset) bytesSkipped += dis.skipBytes(offset-bytesSkipped); blockType = dis.readInt(); int skipped = dis.readInt(); //Skip 4 bytes forward outOffset = dis.readLong()*0x200;//(dis.readInt() & 0xffffffffL)*0x200; //unsigned int -> long //dis.readInt(); //Skip 4 bytes forward outSize = dis.readLong()*0x200;//(dis.readInt() & 0xffffffffL)*0x200; //unsigned int -> long inOffset = dis.readLong();// & 0xffffffffL; //unsigned int -> long //dis.readInt(); //Skip 4 bytes forward inSize = dis.readLong();//dis.readInt() & 0xffffffffL; //unsigned int -> long if(lastByteReadInBlock == -1) lastByteReadInBlock = inOffset; lastByteReadInBlock += inSize; /* The lines below are a "hack" that I had to do to make dmgx work with certain dmg-files. I don't understand the issue at all, which is why this hack is here, but sometimes inOffset == 0 means that it is 0 relative to the previous partition's last inOffset. And sometimes it doesn't (meaning the actual position 0 in the dmg file). */ if(addInOffset) { if(DEBUG) println("!-----addInOffset mode: inOffset tranformation " + inOffset + "->" + (inOffset+lastInOffset)); inOffset += lastInOffset; } else if(inOffset == 0) { if(DEBUG) println("!-----Detected inOffset == 0, setting to " + lastInOffset); addInOffset = true; inOffset = lastInOffset; } outOffset += lastOutOffset; DMGBlock currentBlock = new DMGBlock(blockType, skipped, outOffset, outSize, inOffset, inSize); blocks.add(currentBlock); if(DEBUG) { println("outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize + " lastOutOffset=" + lastOutOffset + " lastInOffset=" + lastInOffset /*+ " lastInOffs=" + lastInOffs + " lastOffs=" + lastOffs*/); } if(blockType == BT_ADC) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_ADC not supported."); ++errorsReported; if(!testOnly) System.exit(0); } else if(blockType == BT_ZLIB) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZLIB processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZLIB FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); try { DMGBlockHandlers.processZlibBlock(currentBlock, dmgRaf, isoRaf, testOnly, dummyMonitor); } catch(DataFormatException dfe) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_ZLIB Could not decode..."); ++errorsReported; if(!DEBUG) { println("outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize + " lastOutOffset=" + lastOutOffset + " lastInOffset=" + lastInOffset); } dfe.printStackTrace(); if(!testOnly) System.exit(0); else { println(" Testing mode, so continuing..."); //System.exit(0); break; } } } else if(blockType == BT_BZIP2) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_BZIP2 not currently supported."); ++errorsReported; if(!testOnly) System.exit(0); } else if(blockType == BT_COPY) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_COPY processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_COPY FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } dmgRaf.seek(/*lastOffs+*/inOffset); int bytesRead = dmgRaf.read(inBuffer, 0, Math.min((int)inSize, inBuffer.length)); long totalBytesRead = bytesRead; while(bytesRead != -1) { reportFilePointerProgress(dmgRaf); if(!testOnly) isoRaf.write(inBuffer, 0, bytesRead); if(totalBytesRead >= inSize) break; bytesRead = dmgRaf.read(inBuffer, 0, Math.min((int)(inSize-totalBytesRead), inBuffer.length)); if(bytesRead > 0) totalBytesRead += bytesRead; } //lastInOffs = inOffset+inSize; } else if(blockType == BT_ZERO) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZERO processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZERO FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } reportFilePointerProgress(dmgRaf); long numberOfZeroBlocks = outSize/zeroblock.length; int numberOfRemainingBytes = (int)(outSize%zeroblock.length); for(int j = 0; j < numberOfZeroBlocks; ++j) { if(!testOnly) isoRaf.write(zeroblock); } if(!testOnly) isoRaf.write(zeroblock, 0, numberOfRemainingBytes); //lastInOffs = inOffset+inSize; } else if(blockType == BT_ZERO2) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZERO2 processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZERO2 FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } reportFilePointerProgress(dmgRaf); long numberOfZeroBlocks = outSize/zeroblock.length; int numberOfRemainingBytes = (int)(outSize%zeroblock.length); for(int j = 0; j < numberOfZeroBlocks; ++j) { if(!testOnly) isoRaf.write(zeroblock); } if(!testOnly) isoRaf.write(zeroblock, 0, numberOfRemainingBytes); //lastInOffs = inOffset+inSize; } else if(blockType == BT_UNKNOWN) { /* I have no idea what this blocktype is... but it's common, and usually doesn't appear more than 2-3 times in a dmg. As long as its input and output sizes are 0, there's no reason to complain... is there? */ if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_UNKNOWN processing..."); if(!(inSize == 0 && outSize == 0)) { println(" " + elementNumber + ":" + blockCount + ". WARNING: Blocktype BT_UNKNOWN had non-zero sizes...", " inSize=" + inSize + ", outSize=" + outSize); ++warningsReported; //println(" The author of the program would be pleased if you contacted him about this."); // ...or would I? } } else if(blockType == BT_END) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_END processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_END FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); //lastOffs += lastInOffs; lastOutOffset = outOffset; lastInOffset += lastByteReadInBlock; } else { println(" " + elementNumber + ":" + blockCount + ". WARNING: previously unseen blocktype " + blockType + " [0x" + Integer.toHexString(blockType) + "]", " " + elementNumber + ":" + blockCount + ". outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize); ++warningsReported; if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". unknown blocktype FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); } offset += 0x28; ++blockCount; } } ++elementNumber; } //printlnVerbose("Progress: 100% Done!"); reportProgress(100); String summary = (errorsReported != 0)?errorsReported+" errors reported":"No errors reported"; summary += (warningsReported != 0)?" ("+warningsReported+" warnings emitted).":"."; if(!graphical) { newline(); println(summary); printlnVerbose("Total extracted bytes: " + totalSize + " B"); } else { progmon.close(); JOptionPane.showMessageDialog(null, "Extraction complete! " + summary + "\n" + "Total extracted bytes: " + totalSize + " B", "Information", JOptionPane.INFORMATION_MESSAGE); System.exit(0); } if(!DEBUG) { if(isoRaf != null) isoRaf.close(); dmgRaf.close(); } else { if(isoRaf != null) isoRaf.close();// System.out.println("blocks.size()=" + blocks.size());// for(DMGBlock b : blocks)// System.out.println(" " + b.toString()); LinkedList<DMGBlock> merged = mergeBlocks(blocks);// System.out.println("merged.size()=" + merged.size());// for(DMGBlock b : merged)// System.out.println(" " + b.toString()); println("Extracting all the parts not containing block data from source file:"); int i = 1; DMGBlock previous = null; for(DMGBlock b : merged) { if(previous == null && b.inOffset > 0) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(0); byte[] data = new byte[(int)(b.inOffset)]; dmgRaf.read(data); curFos.write(data); curFos.close(); } else if(previous != null) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(previous.inOffset+previous.inSize); byte[] data = new byte[(int)(b.inOffset-(previous.inOffset+previous.inSize))]; dmgRaf.read(data); curFos.write(data); curFos.close(); } previous = b; } if(previous.inOffset+previous.inSize != dmgRaf.length()) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(previous.inOffset+previous.inSize); byte[] data = new byte[(int)(dmgRaf.length()-(previous.inOffset+previous.inSize))]; dmgRaf.read(data); curFos.write(data); curFos.close(); } dmgRaf.close(); System.out.println("done!"); } }
public static void notmain(String[] args) throws Exception { if(DEBUG) verbose = true; parseArgs(args); printlnVerbose("Processing: " + dmgFile); RandomAccessFile dmgRaf = new RandomAccessFile(dmgFile, "r"); RandomAccessFile isoRaf = null; boolean testOnly = false; if(isoFile != null) { isoRaf = new RandomAccessFile(isoFile, "rw"); isoRaf.setLength(0); printlnVerbose("Extracting to: " + isoFile); } else { testOnly = true; printlnVerbose("Simulating extraction..."); } dmgRaf.seek(dmgRaf.length()-PLIST_ADDRESS_1); long plistBegin1 = dmgRaf.readLong(); long plistEnd = dmgRaf.readLong(); dmgRaf.seek(dmgRaf.length()-PLIST_ADDRESS_2); long plistBegin2 = dmgRaf.readLong(); long plistSize = dmgRaf.readLong(); if(DEBUG) { println("Read addresses:", " " + plistBegin1, " " + plistBegin2); } if(plistBegin1 != plistBegin2) { println("Addresses not equal! Assumption broken... =/", plistBegin1 + " != " + plistBegin2); System.exit(0); } if(plistSize != (plistEnd-plistBegin1)) { println("plistSize field does not match plistEnd marker!", "plistSize=" + plistSize + " plistBegin1=" + plistBegin1 + " plistEnd=" + plistEnd + " plistEnd-plistBegin1=" + (plistEnd-plistBegin1)); } printlnVerbose("Jumping to address..."); dmgRaf.seek(plistBegin1); byte[] buffer = new byte[(int)plistSize]; dmgRaf.read(buffer); InputStream is = new ByteArrayInputStream(buffer); NodeBuilder handler = new NodeBuilder(); SAXParser saxParser = SAXParserFactory.newInstance().newSAXParser(); try {// System.out.println("validation: " + saxParser.getProperty("validation"));// System.out.println("external-general-entities: " + saxParser.getProperty("external-general-entities"));// System.out.println("external-parameter-entities: " + saxParser.getProperty("external-parameter-entities"));// System.out.println("is-standalone: " + saxParser.getProperty("is-standalone"));// System.out.println("lexical-handler: " + saxParser.getProperty("lexical-handler"));// System.out.println("parameter-entities: " + saxParser.getProperty("parameter-entities"));// System.out.println("namespaces: " + saxParser.getProperty("namespaces"));// System.out.println("namespace-prefixes: " + saxParser.getProperty("namespace-prefixes"));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty("")); //System.out.println("isValidating: " + saxParser.isValidating()); saxParser.parse(is, handler); } catch(SAXException se) { se.printStackTrace(); System.err.println("Could not read the partition list... exiting."); System.exit(1); } XMLNode[] rootNodes = handler.getRoots(); if(rootNodes.length != 1) { println("Could not parse DMG-file!"); System.exit(0); } /* Ok, now we have a tree built from the XML-document. Let's walk to the right place. */ /* cd plist cd dict cdkey resource-fork (type:dict) cdkey blkx (type:array) */ XMLNode current; XMLElement[] children; boolean keyFound; current = rootNodes[0]; //We are at plist... probably (there should be only one root node) current = current.cd("dict"); current = current.cdkey("resource-fork"); current = current.cdkey("blkx"); printlnVerbose("Found " + current.getChildren().length + " partitions:"); byte[] inBuffer = new byte[0x40000]; byte[] outBuffer = new byte[0x40000]; byte[] zeroblock = new byte[4096]; /* I think java always zeroes its arrays on creation... but let's play safe. */ for(int y = 0; y < zeroblock.length; ++y) zeroblock[y] = 0; LinkedList<DMGBlock> blocks = new LinkedList<DMGBlock>(); long elementNumber = 0; //long lastOffs = 0; long lastOutOffset = 0; long lastInOffset = 0; long totalSize = 0; int errorsReported = 0; int warningsReported = 0; reportProgress(0); for(XMLElement xe : current.getChildren()) { if(progmon != null && progmon.isCanceled()) System.exit(0); if(xe instanceof XMLNode) { XMLNode xn = (XMLNode)xe; byte[] data = Base64.decode(xn.getKeyValue("Data")); long partitionSize = calculatePartitionSize(data); totalSize += partitionSize; printlnVerbose(" " + xn.getKeyValue("Name")); printlnVerbose(" ID: " + xn.getKeyValue("ID")); printlnVerbose(" Attributes: " + xn.getKeyValue("Attributes")); printlnVerbose(" Partition map data length: " + data.length + " bytes"); printlnVerbose(" Partition size: " + partitionSize + " bytes"); if(verbose) { printlnVerbose(" Dumping blkx..."); FileOutputStream fos = new FileOutputStream(xn.getKeyValue("ID") + ".blkx"); fos.write(data); fos.close(); } if(DEBUG) { File dumpFile = new File("data " + xn.getKeyValue("ID") + ".bin"); println(" Dumping partition map to file: " + dumpFile); FileOutputStream dump = new FileOutputStream(dumpFile); dump.write(data); dump.close(); } int offset = 0xCC; int blockType = 0; /* Offset of the input data for the current block in the input file */ long inOffset = 0; /* Size of the input data for the current block */ long inSize = 0; /* Offset of the output data for the current block in the output file */ long outOffset = 0; /* Size of the output data (possibly larger than inSize because of decompression, zero expansion...) */ long outSize = 0; long lastByteReadInBlock = -1; boolean addInOffset = false; //, lastInOffs = 0; int blockCount = 0; while(blockType != BT_END) { if(progmon != null && progmon.isCanceled()) System.exit(0); DataInputStream dis = new DataInputStream(new ByteArrayInputStream(data)); int bytesSkipped = 0; while(bytesSkipped < offset) bytesSkipped += dis.skipBytes(offset-bytesSkipped); blockType = dis.readInt(); int skipped = dis.readInt(); //Skip 4 bytes forward outOffset = dis.readLong()*0x200;//(dis.readInt() & 0xffffffffL)*0x200; //unsigned int -> long //dis.readInt(); //Skip 4 bytes forward outSize = dis.readLong()*0x200;//(dis.readInt() & 0xffffffffL)*0x200; //unsigned int -> long inOffset = dis.readLong();// & 0xffffffffL; //unsigned int -> long //dis.readInt(); //Skip 4 bytes forward inSize = dis.readLong();//dis.readInt() & 0xffffffffL; //unsigned int -> long if(lastByteReadInBlock == -1) lastByteReadInBlock = inOffset; lastByteReadInBlock += inSize; /* The lines below are a "hack" that I had to do to make dmgx work with certain dmg-files. I don't understand the issue at all, which is why this hack is here, but sometimes inOffset == 0 means that it is 0 relative to the previous partition's last inOffset. And sometimes it doesn't (meaning the actual position 0 in the dmg file). */ if(addInOffset) { if(DEBUG) println("!-----addInOffset mode: inOffset tranformation " + inOffset + "->" + (inOffset+lastInOffset)); inOffset += lastInOffset; } else if(inOffset == 0) { if(DEBUG) println("!-----Detected inOffset == 0, setting to " + lastInOffset); addInOffset = true; inOffset = lastInOffset; } outOffset += lastOutOffset; DMGBlock currentBlock = new DMGBlock(blockType, skipped, outOffset, outSize, inOffset, inSize); blocks.add(currentBlock); if(DEBUG) { println("outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize + " lastOutOffset=" + lastOutOffset + " lastInOffset=" + lastInOffset /*+ " lastInOffs=" + lastInOffs + " lastOffs=" + lastOffs*/); } if(blockType == BT_ADC) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_ADC not supported."); ++errorsReported; if(!testOnly) System.exit(0); } else if(blockType == BT_ZLIB) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZLIB processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZLIB FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); try { DMGBlockHandlers.processZlibBlock(currentBlock, dmgRaf, isoRaf, testOnly, dummyMonitor); } catch(DataFormatException dfe) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_ZLIB Could not decode..."); ++errorsReported; if(!DEBUG) { println("outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize + " lastOutOffset=" + lastOutOffset + " lastInOffset=" + lastInOffset); } dfe.printStackTrace(); if(!testOnly) System.exit(0); else { println(" Testing mode, so continuing..."); //System.exit(0); break; } } } else if(blockType == BT_BZIP2) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_BZIP2 not currently supported."); ++errorsReported; if(!testOnly) System.exit(0); } else if(blockType == BT_COPY) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_COPY processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_COPY FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } dmgRaf.seek(/*lastOffs+*/inOffset); int bytesRead = dmgRaf.read(inBuffer, 0, Math.min((int)inSize, inBuffer.length)); long totalBytesRead = bytesRead; while(bytesRead != -1) { reportFilePointerProgress(dmgRaf); if(!testOnly) isoRaf.write(inBuffer, 0, bytesRead); if(totalBytesRead >= inSize) break; bytesRead = dmgRaf.read(inBuffer, 0, Math.min((int)(inSize-totalBytesRead), inBuffer.length)); if(bytesRead > 0) totalBytesRead += bytesRead; } //lastInOffs = inOffset+inSize; } else if(blockType == BT_ZERO) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZERO processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZERO FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } reportFilePointerProgress(dmgRaf); long numberOfZeroBlocks = outSize/zeroblock.length; int numberOfRemainingBytes = (int)(outSize%zeroblock.length); for(int j = 0; j < numberOfZeroBlocks; ++j) { if(!testOnly) isoRaf.write(zeroblock); } if(!testOnly) isoRaf.write(zeroblock, 0, numberOfRemainingBytes); //lastInOffs = inOffset+inSize; } else if(blockType == BT_ZERO2) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZERO2 processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZERO2 FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } reportFilePointerProgress(dmgRaf); long numberOfZeroBlocks = outSize/zeroblock.length; int numberOfRemainingBytes = (int)(outSize%zeroblock.length); for(int j = 0; j < numberOfZeroBlocks; ++j) { if(!testOnly) isoRaf.write(zeroblock); } if(!testOnly) isoRaf.write(zeroblock, 0, numberOfRemainingBytes); //lastInOffs = inOffset+inSize; } else if(blockType == BT_UNKNOWN) { /* I have no idea what this blocktype is... but it's common, and usually doesn't appear more than 2-3 times in a dmg. As long as its input and output sizes are 0, there's no reason to complain... is there? */ if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_UNKNOWN processing..."); if(!(inSize == 0 && outSize == 0)) { println(" " + elementNumber + ":" + blockCount + ". WARNING: Blocktype BT_UNKNOWN had non-zero sizes...", " inSize=" + inSize + ", outSize=" + outSize); ++warningsReported; //println(" The author of the program would be pleased if you contacted him about this."); // ...or would I? } } else if(blockType == BT_END) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_END processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_END FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); //lastOffs += lastInOffs; lastOutOffset = outOffset; lastInOffset += lastByteReadInBlock; } else { println(" " + elementNumber + ":" + blockCount + ". WARNING: previously unseen blocktype " + blockType + " [0x" + Integer.toHexString(blockType) + "]", " " + elementNumber + ":" + blockCount + ". outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize); ++warningsReported; if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". unknown blocktype FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); } offset += 0x28; ++blockCount; } } ++elementNumber; } //printlnVerbose("Progress: 100% Done!"); reportProgress(100); String summary = (errorsReported != 0)?errorsReported+" errors reported":"No errors reported"; summary += (warningsReported != 0)?" ("+warningsReported+" warnings emitted).":"."; if(!graphical) { newline(); println(summary); printlnVerbose("Total extracted bytes: " + totalSize + " B"); } else { progmon.close(); JOptionPane.showMessageDialog(null, "Extraction complete! " + summary + "\n" + "Total extracted bytes: " + totalSize + " B", "Information", JOptionPane.INFORMATION_MESSAGE); System.exit(0); } if(!DEBUG) { if(isoRaf != null) isoRaf.close(); dmgRaf.close(); } else { if(isoRaf != null) isoRaf.close();// System.out.println("blocks.size()=" + blocks.size());// for(DMGBlock b : blocks)// System.out.println(" " + b.toString()); LinkedList<DMGBlock> merged = mergeBlocks(blocks);// System.out.println("merged.size()=" + merged.size());// for(DMGBlock b : merged)// System.out.println(" " + b.toString()); println("Extracting all the parts not containing block data from source file:"); int i = 1; DMGBlock previous = null; for(DMGBlock b : merged) { if(previous == null && b.inOffset > 0) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(0); byte[] data = new byte[(int)(b.inOffset)]; dmgRaf.read(data); curFos.write(data); curFos.close(); } else if(previous != null) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(previous.inOffset+previous.inSize); byte[] data = new byte[(int)(b.inOffset-(previous.inOffset+previous.inSize))]; dmgRaf.read(data); curFos.write(data); curFos.close(); } previous = b; } if(previous.inOffset+previous.inSize != dmgRaf.length()) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(previous.inOffset+previous.inSize); byte[] data = new byte[(int)(dmgRaf.length()-(previous.inOffset+previous.inSize))]; dmgRaf.read(data); curFos.write(data); curFos.close(); } dmgRaf.close(); System.out.println("done!"); } }
1,114,676
public static void notmain(String[] args) throws Exception { if(DEBUG) verbose = true; parseArgs(args); printlnVerbose("Processing: " + dmgFile); RandomAccessFile dmgRaf = new RandomAccessFile(dmgFile, "r"); RandomAccessFile isoRaf = null; boolean testOnly = false; if(isoFile != null) { isoRaf = new RandomAccessFile(isoFile, "rw"); isoRaf.setLength(0); printlnVerbose("Extracting to: " + isoFile); } else { testOnly = true; printlnVerbose("Simulating extraction..."); } dmgRaf.seek(dmgRaf.length()-PLIST_ADDRESS_1); long plistBegin1 = dmgRaf.readLong(); long plistEnd = dmgRaf.readLong(); dmgRaf.seek(dmgRaf.length()-PLIST_ADDRESS_2); long plistBegin2 = dmgRaf.readLong(); long plistSize = dmgRaf.readLong(); if(DEBUG) { println("Read addresses:", " " + plistBegin1, " " + plistBegin2); } if(plistBegin1 != plistBegin2) { println("Addresses not equal! Assumption broken... =/", plistBegin1 + " != " + plistBegin2); System.exit(0); } if(plistSize != (plistEnd-plistBegin1)) { println("plistSize field does not match plistEnd marker!", "plistSize=" + plistSize + " plistBegin1=" + plistBegin1 + " plistEnd=" + plistEnd + " plistEnd-plistBegin1=" + (plistEnd-plistBegin1)); } printlnVerbose("Jumping to address..."); dmgRaf.seek(plistBegin1); byte[] buffer = new byte[(int)plistSize]; dmgRaf.read(buffer); InputStream is = new ByteArrayInputStream(buffer); NodeBuilder handler = new NodeBuilder(); SAXParser saxParser = SAXParserFactory.newInstance().newSAXParser(); try {// System.out.println("validation: " + saxParser.getProperty("validation"));// System.out.println("external-general-entities: " + saxParser.getProperty("external-general-entities"));// System.out.println("external-parameter-entities: " + saxParser.getProperty("external-parameter-entities"));// System.out.println("is-standalone: " + saxParser.getProperty("is-standalone"));// System.out.println("lexical-handler: " + saxParser.getProperty("lexical-handler"));// System.out.println("parameter-entities: " + saxParser.getProperty("parameter-entities"));// System.out.println("namespaces: " + saxParser.getProperty("namespaces"));// System.out.println("namespace-prefixes: " + saxParser.getProperty("namespace-prefixes"));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty("")); //System.out.println("isValidating: " + saxParser.isValidating()); saxParser.parse(is, handler); } catch(SAXException se) { se.printStackTrace(); System.err.println("Could not read the partition list... exiting."); System.exit(1); } XMLNode[] rootNodes = handler.getRoots(); if(rootNodes.length != 1) { println("Could not parse DMG-file!"); System.exit(0); } /* Ok, now we have a tree built from the XML-document. Let's walk to the right place. */ /* cd plist cd dict cdkey resource-fork (type:dict) cdkey blkx (type:array) */ XMLNode current; XMLElement[] children; boolean keyFound; current = rootNodes[0]; //We are at plist... probably (there should be only one root node) current = current.cd("dict"); current = current.cdkey("resource-fork"); current = current.cdkey("blkx"); printlnVerbose("Found " + current.getChildren().length + " partitions:"); byte[] inBuffer = new byte[0x40000]; byte[] outBuffer = new byte[0x40000]; byte[] zeroblock = new byte[4096]; /* I think java always zeroes its arrays on creation... but let's play safe. */ for(int y = 0; y < zeroblock.length; ++y) zeroblock[y] = 0; LinkedList<DMGBlock> blocks = new LinkedList<DMGBlock>(); long elementNumber = 0; //long lastOffs = 0; long lastOutOffset = 0; long lastInOffset = 0; long totalSize = 0; int errorsReported = 0; int warningsReported = 0; reportProgress(0); for(XMLElement xe : current.getChildren()) { if(progmon != null && progmon.isCanceled()) System.exit(0); if(xe instanceof XMLNode) { XMLNode xn = (XMLNode)xe; byte[] data = Base64.decode(xn.getKeyValue("Data")); long partitionSize = calculatePartitionSize(data); totalSize += partitionSize; printlnVerbose(" " + xn.getKeyValue("Name")); printlnVerbose(" ID: " + xn.getKeyValue("ID")); printlnVerbose(" Attributes: " + xn.getKeyValue("Attributes")); printlnVerbose(" Partition map data length: " + data.length + " bytes"); printlnVerbose(" Partition size: " + partitionSize + " bytes"); if(verbose) { printlnVerbose(" Dumping blkx..."); FileOutputStream fos = new FileOutputStream(xn.getKeyValue("ID") + ".blkx"); fos.write(data); fos.close(); } if(DEBUG) { File dumpFile = new File("data " + xn.getKeyValue("ID") + ".bin"); println(" Dumping partition map to file: " + dumpFile); FileOutputStream dump = new FileOutputStream(dumpFile); dump.write(data); dump.close(); } int offset = 0xCC; int blockType = 0; /* Offset of the input data for the current block in the input file */ long inOffset = 0; /* Size of the input data for the current block */ long inSize = 0; /* Offset of the output data for the current block in the output file */ long outOffset = 0; /* Size of the output data (possibly larger than inSize because of decompression, zero expansion...) */ long outSize = 0; long lastByteReadInBlock = -1; boolean addInOffset = false; //, lastInOffs = 0; int blockCount = 0; while(blockType != BT_END) { if(progmon != null && progmon.isCanceled()) System.exit(0); DataInputStream dis = new DataInputStream(new ByteArrayInputStream(data)); int bytesSkipped = 0; while(bytesSkipped < offset) bytesSkipped += dis.skipBytes(offset-bytesSkipped); blockType = dis.readInt(); int skipped = dis.readInt(); //Skip 4 bytes forward outOffset = dis.readLong()*0x200;//(dis.readInt() & 0xffffffffL)*0x200; //unsigned int -> long //dis.readInt(); //Skip 4 bytes forward outSize = dis.readLong()*0x200;//(dis.readInt() & 0xffffffffL)*0x200; //unsigned int -> long inOffset = dis.readLong();// & 0xffffffffL; //unsigned int -> long //dis.readInt(); //Skip 4 bytes forward inSize = dis.readLong();//dis.readInt() & 0xffffffffL; //unsigned int -> long if(lastByteReadInBlock == -1) lastByteReadInBlock = inOffset; lastByteReadInBlock += inSize; /* The lines below are a "hack" that I had to do to make dmgx work with certain dmg-files. I don't understand the issue at all, which is why this hack is here, but sometimes inOffset == 0 means that it is 0 relative to the previous partition's last inOffset. And sometimes it doesn't (meaning the actual position 0 in the dmg file). */ if(addInOffset) { if(DEBUG) println("!-----addInOffset mode: inOffset tranformation " + inOffset + "->" + (inOffset+lastInOffset)); inOffset += lastInOffset; } else if(inOffset == 0) { if(DEBUG) println("!-----Detected inOffset == 0, setting to " + lastInOffset); addInOffset = true; inOffset = lastInOffset; } outOffset += lastOutOffset; DMGBlock currentBlock = new DMGBlock(blockType, skipped, outOffset, outSize, inOffset, inSize); blocks.add(currentBlock); if(DEBUG) { println("outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize + " lastOutOffset=" + lastOutOffset + " lastInOffset=" + lastInOffset /*+ " lastInOffs=" + lastInOffs + " lastOffs=" + lastOffs*/); } if(blockType == BT_ADC) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_ADC not supported."); ++errorsReported; if(!testOnly) System.exit(0); } else if(blockType == BT_ZLIB) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZLIB processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZLIB FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); try { DMGBlockHandlers.processZlibBlock(currentBlock, dmgRaf, isoRaf, testOnly, dummyMonitor); } catch(DataFormatException dfe) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_ZLIB Could not decode..."); ++errorsReported; if(!DEBUG) { println("outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize + " lastOutOffset=" + lastOutOffset + " lastInOffset=" + lastInOffset); } dfe.printStackTrace(); if(!testOnly) System.exit(0); else { println(" Testing mode, so continuing..."); //System.exit(0); break; } } } else if(blockType == BT_BZIP2) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_BZIP2 not currently supported."); ++errorsReported; if(!testOnly) System.exit(0); } else if(blockType == BT_COPY) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_COPY processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_COPY FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } dmgRaf.seek(/*lastOffs+*/inOffset); int bytesRead = dmgRaf.read(inBuffer, 0, Math.min((int)inSize, inBuffer.length)); long totalBytesRead = bytesRead; while(bytesRead != -1) { reportFilePointerProgress(dmgRaf); if(!testOnly) isoRaf.write(inBuffer, 0, bytesRead); if(totalBytesRead >= inSize) break; bytesRead = dmgRaf.read(inBuffer, 0, Math.min((int)(inSize-totalBytesRead), inBuffer.length)); if(bytesRead > 0) totalBytesRead += bytesRead; } //lastInOffs = inOffset+inSize; } else if(blockType == BT_ZERO) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZERO processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZERO FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } reportFilePointerProgress(dmgRaf); long numberOfZeroBlocks = outSize/zeroblock.length; int numberOfRemainingBytes = (int)(outSize%zeroblock.length); for(int j = 0; j < numberOfZeroBlocks; ++j) { if(!testOnly) isoRaf.write(zeroblock); } if(!testOnly) isoRaf.write(zeroblock, 0, numberOfRemainingBytes); //lastInOffs = inOffset+inSize; } else if(blockType == BT_ZERO2) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZERO2 processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZERO2 FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } reportFilePointerProgress(dmgRaf); long numberOfZeroBlocks = outSize/zeroblock.length; int numberOfRemainingBytes = (int)(outSize%zeroblock.length); for(int j = 0; j < numberOfZeroBlocks; ++j) { if(!testOnly) isoRaf.write(zeroblock); } if(!testOnly) isoRaf.write(zeroblock, 0, numberOfRemainingBytes); //lastInOffs = inOffset+inSize; } else if(blockType == BT_UNKNOWN) { /* I have no idea what this blocktype is... but it's common, and usually doesn't appear more than 2-3 times in a dmg. As long as its input and output sizes are 0, there's no reason to complain... is there? */ if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_UNKNOWN processing..."); if(!(inSize == 0 && outSize == 0)) { println(" " + elementNumber + ":" + blockCount + ". WARNING: Blocktype BT_UNKNOWN had non-zero sizes...", " inSize=" + inSize + ", outSize=" + outSize); ++warningsReported; //println(" The author of the program would be pleased if you contacted him about this."); // ...or would I? } } else if(blockType == BT_END) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_END processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_END FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); //lastOffs += lastInOffs; lastOutOffset = outOffset; lastInOffset += lastByteReadInBlock; } else { println(" " + elementNumber + ":" + blockCount + ". WARNING: previously unseen blocktype " + blockType + " [0x" + Integer.toHexString(blockType) + "]", " " + elementNumber + ":" + blockCount + ". outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize); ++warningsReported; if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". unknown blocktype FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); } offset += 0x28; ++blockCount; } } ++elementNumber; } //printlnVerbose("Progress: 100% Done!"); reportProgress(100); String summary = (errorsReported != 0)?errorsReported+" errors reported":"No errors reported"; summary += (warningsReported != 0)?" ("+warningsReported+" warnings emitted).":"."; if(!graphical) { newline(); println(summary); printlnVerbose("Total extracted bytes: " + totalSize + " B"); } else { progmon.close(); JOptionPane.showMessageDialog(null, "Extraction complete! " + summary + "\n" + "Total extracted bytes: " + totalSize + " B", "Information", JOptionPane.INFORMATION_MESSAGE); System.exit(0); } if(!DEBUG) { if(isoRaf != null) isoRaf.close(); dmgRaf.close(); } else { if(isoRaf != null) isoRaf.close();// System.out.println("blocks.size()=" + blocks.size());// for(DMGBlock b : blocks)// System.out.println(" " + b.toString()); LinkedList<DMGBlock> merged = mergeBlocks(blocks);// System.out.println("merged.size()=" + merged.size());// for(DMGBlock b : merged)// System.out.println(" " + b.toString()); println("Extracting all the parts not containing block data from source file:"); int i = 1; DMGBlock previous = null; for(DMGBlock b : merged) { if(previous == null && b.inOffset > 0) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(0); byte[] data = new byte[(int)(b.inOffset)]; dmgRaf.read(data); curFos.write(data); curFos.close(); } else if(previous != null) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(previous.inOffset+previous.inSize); byte[] data = new byte[(int)(b.inOffset-(previous.inOffset+previous.inSize))]; dmgRaf.read(data); curFos.write(data); curFos.close(); } previous = b; } if(previous.inOffset+previous.inSize != dmgRaf.length()) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(previous.inOffset+previous.inSize); byte[] data = new byte[(int)(dmgRaf.length()-(previous.inOffset+previous.inSize))]; dmgRaf.read(data); curFos.write(data); curFos.close(); } dmgRaf.close(); System.out.println("done!"); } }
public static void notmain(String[] args) throws Exception { if(DEBUG) verbose = true; parseArgs(args); printlnVerbose("Processing: " + dmgFile); RandomAccessFile dmgRaf = new RandomAccessFile(dmgFile, "r"); RandomAccessFile isoRaf = null; boolean testOnly = false; if(isoFile != null) { isoRaf = new RandomAccessFile(isoFile, "rw"); isoRaf.setLength(0); printlnVerbose("Extracting to: " + isoFile); } else { testOnly = true; printlnVerbose("Simulating extraction..."); } dmgRaf.seek(dmgRaf.length()-PLIST_ADDRESS_1); long plistBegin1 = dmgRaf.readLong(); long plistEnd = dmgRaf.readLong(); dmgRaf.seek(dmgRaf.length()-PLIST_ADDRESS_2); long plistBegin2 = dmgRaf.readLong(); long plistSize = dmgRaf.readLong(); if(DEBUG) { println("Read addresses:", " " + plistBegin1, " " + plistBegin2); } if(plistBegin1 != plistBegin2) { println("Addresses not equal! Assumption broken... =/", plistBegin1 + " != " + plistBegin2); System.exit(0); } if(plistSize != (plistEnd-plistBegin1)) { println("plistSize field does not match plistEnd marker!", "plistSize=" + plistSize + " plistBegin1=" + plistBegin1 + " plistEnd=" + plistEnd + " plistEnd-plistBegin1=" + (plistEnd-plistBegin1)); } printlnVerbose("Jumping to address..."); dmgRaf.seek(plistBegin1); byte[] buffer = new byte[(int)plistSize]; dmgRaf.read(buffer); InputStream is = new ByteArrayInputStream(buffer); NodeBuilder handler = new NodeBuilder(); SAXParser saxParser = SAXParserFactory.newInstance().newSAXParser(); try {// System.out.println("validation: " + saxParser.getProperty("validation"));// System.out.println("external-general-entities: " + saxParser.getProperty("external-general-entities"));// System.out.println("external-parameter-entities: " + saxParser.getProperty("external-parameter-entities"));// System.out.println("is-standalone: " + saxParser.getProperty("is-standalone"));// System.out.println("lexical-handler: " + saxParser.getProperty("lexical-handler"));// System.out.println("parameter-entities: " + saxParser.getProperty("parameter-entities"));// System.out.println("namespaces: " + saxParser.getProperty("namespaces"));// System.out.println("namespace-prefixes: " + saxParser.getProperty("namespace-prefixes"));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty("")); //System.out.println("isValidating: " + saxParser.isValidating()); saxParser.parse(is, handler); } catch(SAXException se) { se.printStackTrace(); System.err.println("Could not read the partition list... exiting."); System.exit(1); } XMLNode[] rootNodes = handler.getRoots(); if(rootNodes.length != 1) { println("Could not parse DMG-file!"); System.exit(0); } /* Ok, now we have a tree built from the XML-document. Let's walk to the right place. */ /* cd plist cd dict cdkey resource-fork (type:dict) cdkey blkx (type:array) */ XMLNode current; XMLElement[] children; boolean keyFound; current = rootNodes[0]; //We are at plist... probably (there should be only one root node) current = current.cd("dict"); current = current.cdkey("resource-fork"); current = current.cdkey("blkx"); printlnVerbose("Found " + current.getChildren().length + " partitions:"); byte[] inBuffer = new byte[0x40000]; byte[] outBuffer = new byte[0x40000]; byte[] zeroblock = new byte[4096]; /* I think java always zeroes its arrays on creation... but let's play safe. */ for(int y = 0; y < zeroblock.length; ++y) zeroblock[y] = 0; LinkedList<DMGBlock> blocks = new LinkedList<DMGBlock>(); long elementNumber = 0; //long lastOffs = 0; long lastOutOffset = 0; long lastInOffset = 0; long totalSize = 0; int errorsReported = 0; int warningsReported = 0; reportProgress(0); for(XMLElement xe : current.getChildren()) { if(progmon != null && progmon.isCanceled()) System.exit(0); if(xe instanceof XMLNode) { XMLNode xn = (XMLNode)xe; byte[] data = Base64.decode(xn.getKeyValue("Data")); long partitionSize = calculatePartitionSize(data); totalSize += partitionSize; printlnVerbose(" " + xn.getKeyValue("Name")); printlnVerbose(" ID: " + xn.getKeyValue("ID")); printlnVerbose(" Attributes: " + xn.getKeyValue("Attributes")); printlnVerbose(" Partition map data length: " + data.length + " bytes"); printlnVerbose(" Partition size: " + partitionSize + " bytes"); if(verbose) { printlnVerbose(" Dumping blkx..."); FileOutputStream fos = new FileOutputStream(xn.getKeyValue("ID") + ".blkx"); fos.write(data); fos.close(); } if(DEBUG) { File dumpFile = new File("data " + xn.getKeyValue("ID") + ".bin"); println(" Dumping partition map to file: " + dumpFile); FileOutputStream dump = new FileOutputStream(dumpFile); dump.write(data); dump.close(); } int offset = 0xCC; int blockType = 0; /* Offset of the input data for the current block in the input file */ long inOffset = 0; /* Size of the input data for the current block */ long inSize = 0; /* Offset of the output data for the current block in the output file */ long outOffset = 0; /* Size of the output data (possibly larger than inSize because of decompression, zero expansion...) */ long outSize = 0; long lastByteReadInBlock = -1; boolean addInOffset = false; //, lastInOffs = 0; int blockCount = 0; while(blockType != BT_END) { if(progmon != null && progmon.isCanceled()) System.exit(0); DataInputStream dis = new DataInputStream(new ByteArrayInputStream(data)); int bytesSkipped = 0; while(bytesSkipped < offset) bytesSkipped += dis.skipBytes(offset-bytesSkipped); blockType = dis.readInt(); int skipped = dis.readInt(); //Skip 4 bytes forward outOffset = dis.readLong()*0x200;//(dis.readInt() & 0xffffffffL)*0x200; //unsigned int -> long //dis.readInt(); //Skip 4 bytes forward outSize = dis.readLong()*0x200;//(dis.readInt() & 0xffffffffL)*0x200; //unsigned int -> long inOffset = dis.readLong();// & 0xffffffffL; //unsigned int -> long //dis.readInt(); //Skip 4 bytes forward inSize = dis.readLong();//dis.readInt() & 0xffffffffL; //unsigned int -> long if(lastByteReadInBlock == -1) lastByteReadInBlock = inOffset; lastByteReadInBlock += inSize; /* The lines below are a "hack" that I had to do to make dmgx work with certain dmg-files. I don't understand the issue at all, which is why this hack is here, but sometimes inOffset == 0 means that it is 0 relative to the previous partition's last inOffset. And sometimes it doesn't (meaning the actual position 0 in the dmg file). */ if(addInOffset) { if(DEBUG) println("!-----addInOffset mode: inOffset tranformation " + inOffset + "->" + (inOffset+lastInOffset)); inOffset += lastInOffset; } else if(inOffset == 0) { if(DEBUG) println("!-----Detected inOffset == 0, setting to " + lastInOffset); addInOffset = true; inOffset = lastInOffset; } outOffset += lastOutOffset; DMGBlock currentBlock = new DMGBlock(blockType, skipped, outOffset, outSize, inOffset, inSize); blocks.add(currentBlock); if(DEBUG) { println("outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize + " lastOutOffset=" + lastOutOffset + " lastInOffset=" + lastInOffset /*+ " lastInOffs=" + lastInOffs + " lastOffs=" + lastOffs*/); } if(blockType == BT_ADC) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_ADC not supported."); ++errorsReported; if(!testOnly) System.exit(0); } else if(blockType == BT_ZLIB) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZLIB processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZLIB FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); try { DMGBlockHandlers.processZlibBlock(currentBlock, dmgRaf, isoRaf, testOnly, dummyMonitor); } catch(DataFormatException dfe) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_ZLIB Could not decode..."); ++errorsReported; if(!DEBUG) { println("outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize + " lastOutOffset=" + lastOutOffset + " lastInOffset=" + lastInOffset); } dfe.printStackTrace(); if(!testOnly) System.exit(0); else { println(" Testing mode, so continuing..."); //System.exit(0); break; } } } else if(blockType == BT_BZIP2) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_BZIP2 not currently supported."); ++errorsReported; if(!testOnly) System.exit(0); } else if(blockType == BT_COPY) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_COPY processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_COPY FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } dmgRaf.seek(/*lastOffs+*/inOffset); int bytesRead = dmgRaf.read(inBuffer, 0, Math.min((int)inSize, inBuffer.length)); long totalBytesRead = bytesRead; while(bytesRead != -1) { reportFilePointerProgress(dmgRaf); if(!testOnly) isoRaf.write(inBuffer, 0, bytesRead); if(totalBytesRead >= inSize) break; bytesRead = dmgRaf.read(inBuffer, 0, Math.min((int)(inSize-totalBytesRead), inBuffer.length)); if(bytesRead > 0) totalBytesRead += bytesRead; } //lastInOffs = inOffset+inSize; } else if(blockType == BT_ZERO) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZERO processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZERO FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } reportFilePointerProgress(dmgRaf); long numberOfZeroBlocks = outSize/zeroblock.length; int numberOfRemainingBytes = (int)(outSize%zeroblock.length); for(int j = 0; j < numberOfZeroBlocks; ++j) { if(!testOnly) isoRaf.write(zeroblock); } if(!testOnly) isoRaf.write(zeroblock, 0, numberOfRemainingBytes); //lastInOffs = inOffset+inSize; } else if(blockType == BT_ZERO2) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZERO2 processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZERO2 FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } reportFilePointerProgress(dmgRaf); long numberOfZeroBlocks = outSize/zeroblock.length; int numberOfRemainingBytes = (int)(outSize%zeroblock.length); for(int j = 0; j < numberOfZeroBlocks; ++j) { if(!testOnly) isoRaf.write(zeroblock); } if(!testOnly) isoRaf.write(zeroblock, 0, numberOfRemainingBytes); //lastInOffs = inOffset+inSize; } else if(blockType == BT_UNKNOWN) { /* I have no idea what this blocktype is... but it's common, and usually doesn't appear more than 2-3 times in a dmg. As long as its input and output sizes are 0, there's no reason to complain... is there? */ if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_UNKNOWN processing..."); if(!(inSize == 0 && outSize == 0)) { println(" " + elementNumber + ":" + blockCount + ". WARNING: Blocktype BT_UNKNOWN had non-zero sizes...", " inSize=" + inSize + ", outSize=" + outSize); ++warningsReported; //println(" The author of the program would be pleased if you contacted him about this."); // ...or would I? } } else if(blockType == BT_END) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_END processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_END FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); //lastOffs += lastInOffs; lastOutOffset = outOffset; lastInOffset += lastByteReadInBlock; } else { println(" " + elementNumber + ":" + blockCount + ". WARNING: previously unseen blocktype " + blockType + " [0x" + Integer.toHexString(blockType) + "]", " " + elementNumber + ":" + blockCount + ". outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize); ++warningsReported; if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". unknown blocktype FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); } offset += 0x28; ++blockCount; } } ++elementNumber; } //printlnVerbose("Progress: 100% Done!"); reportProgress(100); String summary = (errorsReported != 0)?errorsReported+" errors reported":"No errors reported"; summary += (warningsReported != 0)?" ("+warningsReported+" warnings emitted).":"."; if(!graphical) { newline(); println(summary); printlnVerbose("Total extracted bytes: " + totalSize + " B"); } else { progmon.close(); JOptionPane.showMessageDialog(null, "Extraction complete! " + summary + "\n" + "Total extracted bytes: " + totalSize + " B", "Information", JOptionPane.INFORMATION_MESSAGE); System.exit(0); } if(!DEBUG) { if(isoRaf != null) isoRaf.close(); dmgRaf.close(); } else { if(isoRaf != null) isoRaf.close();// System.out.println("blocks.size()=" + blocks.size());// for(DMGBlock b : blocks)// System.out.println(" " + b.toString()); LinkedList<DMGBlock> merged = mergeBlocks(blocks);// System.out.println("merged.size()=" + merged.size());// for(DMGBlock b : merged)// System.out.println(" " + b.toString()); println("Extracting all the parts not containing block data from source file:"); int i = 1; DMGBlock previous = null; for(DMGBlock b : merged) { if(previous == null && b.inOffset > 0) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(0); byte[] data = new byte[(int)(b.inOffset)]; dmgRaf.read(data); curFos.write(data); curFos.close(); } else if(previous != null) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(previous.inOffset+previous.inSize); byte[] data = new byte[(int)(b.inOffset-(previous.inOffset+previous.inSize))]; dmgRaf.read(data); curFos.write(data); curFos.close(); } previous = b; } if(previous.inOffset+previous.inSize != dmgRaf.length()) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(previous.inOffset+previous.inSize); byte[] data = new byte[(int)(dmgRaf.length()-(previous.inOffset+previous.inSize))]; dmgRaf.read(data); curFos.write(data); curFos.close(); } dmgRaf.close(); System.out.println("done!"); } }
1,114,677
public static void notmain(String[] args) throws Exception { if(DEBUG) verbose = true; parseArgs(args); printlnVerbose("Processing: " + dmgFile); RandomAccessFile dmgRaf = new RandomAccessFile(dmgFile, "r"); RandomAccessFile isoRaf = null; boolean testOnly = false; if(isoFile != null) { isoRaf = new RandomAccessFile(isoFile, "rw"); isoRaf.setLength(0); printlnVerbose("Extracting to: " + isoFile); } else { testOnly = true; printlnVerbose("Simulating extraction..."); } dmgRaf.seek(dmgRaf.length()-PLIST_ADDRESS_1); long plistBegin1 = dmgRaf.readLong(); long plistEnd = dmgRaf.readLong(); dmgRaf.seek(dmgRaf.length()-PLIST_ADDRESS_2); long plistBegin2 = dmgRaf.readLong(); long plistSize = dmgRaf.readLong(); if(DEBUG) { println("Read addresses:", " " + plistBegin1, " " + plistBegin2); } if(plistBegin1 != plistBegin2) { println("Addresses not equal! Assumption broken... =/", plistBegin1 + " != " + plistBegin2); System.exit(0); } if(plistSize != (plistEnd-plistBegin1)) { println("plistSize field does not match plistEnd marker!", "plistSize=" + plistSize + " plistBegin1=" + plistBegin1 + " plistEnd=" + plistEnd + " plistEnd-plistBegin1=" + (plistEnd-plistBegin1)); } printlnVerbose("Jumping to address..."); dmgRaf.seek(plistBegin1); byte[] buffer = new byte[(int)plistSize]; dmgRaf.read(buffer); InputStream is = new ByteArrayInputStream(buffer); NodeBuilder handler = new NodeBuilder(); SAXParser saxParser = SAXParserFactory.newInstance().newSAXParser(); try {// System.out.println("validation: " + saxParser.getProperty("validation"));// System.out.println("external-general-entities: " + saxParser.getProperty("external-general-entities"));// System.out.println("external-parameter-entities: " + saxParser.getProperty("external-parameter-entities"));// System.out.println("is-standalone: " + saxParser.getProperty("is-standalone"));// System.out.println("lexical-handler: " + saxParser.getProperty("lexical-handler"));// System.out.println("parameter-entities: " + saxParser.getProperty("parameter-entities"));// System.out.println("namespaces: " + saxParser.getProperty("namespaces"));// System.out.println("namespace-prefixes: " + saxParser.getProperty("namespace-prefixes"));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty("")); //System.out.println("isValidating: " + saxParser.isValidating()); saxParser.parse(is, handler); } catch(SAXException se) { se.printStackTrace(); System.err.println("Could not read the partition list... exiting."); System.exit(1); } XMLNode[] rootNodes = handler.getRoots(); if(rootNodes.length != 1) { println("Could not parse DMG-file!"); System.exit(0); } /* Ok, now we have a tree built from the XML-document. Let's walk to the right place. */ /* cd plist cd dict cdkey resource-fork (type:dict) cdkey blkx (type:array) */ XMLNode current; XMLElement[] children; boolean keyFound; current = rootNodes[0]; //We are at plist... probably (there should be only one root node) current = current.cd("dict"); current = current.cdkey("resource-fork"); current = current.cdkey("blkx"); printlnVerbose("Found " + current.getChildren().length + " partitions:"); byte[] inBuffer = new byte[0x40000]; byte[] outBuffer = new byte[0x40000]; byte[] zeroblock = new byte[4096]; /* I think java always zeroes its arrays on creation... but let's play safe. */ for(int y = 0; y < zeroblock.length; ++y) zeroblock[y] = 0; LinkedList<DMGBlock> blocks = new LinkedList<DMGBlock>(); long elementNumber = 0; //long lastOffs = 0; long lastOutOffset = 0; long lastInOffset = 0; long totalSize = 0; int errorsReported = 0; int warningsReported = 0; reportProgress(0); for(XMLElement xe : current.getChildren()) { if(progmon != null && progmon.isCanceled()) System.exit(0); if(xe instanceof XMLNode) { XMLNode xn = (XMLNode)xe; byte[] data = Base64.decode(xn.getKeyValue("Data")); long partitionSize = calculatePartitionSize(data); totalSize += partitionSize; printlnVerbose(" " + xn.getKeyValue("Name")); printlnVerbose(" ID: " + xn.getKeyValue("ID")); printlnVerbose(" Attributes: " + xn.getKeyValue("Attributes")); printlnVerbose(" Partition map data length: " + data.length + " bytes"); printlnVerbose(" Partition size: " + partitionSize + " bytes"); if(verbose) { printlnVerbose(" Dumping blkx..."); FileOutputStream fos = new FileOutputStream(xn.getKeyValue("ID") + ".blkx"); fos.write(data); fos.close(); } if(DEBUG) { File dumpFile = new File("data " + xn.getKeyValue("ID") + ".bin"); println(" Dumping partition map to file: " + dumpFile); FileOutputStream dump = new FileOutputStream(dumpFile); dump.write(data); dump.close(); } int offset = 0xCC; int blockType = 0; /* Offset of the input data for the current block in the input file */ long inOffset = 0; /* Size of the input data for the current block */ long inSize = 0; /* Offset of the output data for the current block in the output file */ long outOffset = 0; /* Size of the output data (possibly larger than inSize because of decompression, zero expansion...) */ long outSize = 0; long lastByteReadInBlock = -1; boolean addInOffset = false; //, lastInOffs = 0; int blockCount = 0; while(blockType != BT_END) { if(progmon != null && progmon.isCanceled()) System.exit(0); DataInputStream dis = new DataInputStream(new ByteArrayInputStream(data)); int bytesSkipped = 0; while(bytesSkipped < offset) bytesSkipped += dis.skipBytes(offset-bytesSkipped); blockType = dis.readInt(); int skipped = dis.readInt(); //Skip 4 bytes forward outOffset = dis.readLong()*0x200;//(dis.readInt() & 0xffffffffL)*0x200; //unsigned int -> long //dis.readInt(); //Skip 4 bytes forward outSize = dis.readLong()*0x200;//(dis.readInt() & 0xffffffffL)*0x200; //unsigned int -> long inOffset = dis.readLong();// & 0xffffffffL; //unsigned int -> long //dis.readInt(); //Skip 4 bytes forward inSize = dis.readLong();//dis.readInt() & 0xffffffffL; //unsigned int -> long if(lastByteReadInBlock == -1) lastByteReadInBlock = inOffset; lastByteReadInBlock += inSize; /* The lines below are a "hack" that I had to do to make dmgx work with certain dmg-files. I don't understand the issue at all, which is why this hack is here, but sometimes inOffset == 0 means that it is 0 relative to the previous partition's last inOffset. And sometimes it doesn't (meaning the actual position 0 in the dmg file). */ if(addInOffset) { if(DEBUG) println("!-----addInOffset mode: inOffset tranformation " + inOffset + "->" + (inOffset+lastInOffset)); inOffset += lastInOffset; } else if(inOffset == 0) { if(DEBUG) println("!-----Detected inOffset == 0, setting to " + lastInOffset); addInOffset = true; inOffset = lastInOffset; } outOffset += lastOutOffset; DMGBlock currentBlock = new DMGBlock(blockType, skipped, outOffset, outSize, inOffset, inSize); blocks.add(currentBlock); if(DEBUG) { println("outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize + " lastOutOffset=" + lastOutOffset + " lastInOffset=" + lastInOffset /*+ " lastInOffs=" + lastInOffs + " lastOffs=" + lastOffs*/); } if(blockType == BT_ADC) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_ADC not supported."); ++errorsReported; if(!testOnly) System.exit(0); } else if(blockType == BT_ZLIB) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZLIB processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZLIB FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); try { DMGBlockHandlers.processZlibBlock(currentBlock, dmgRaf, isoRaf, testOnly, dummyMonitor); } catch(DataFormatException dfe) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_ZLIB Could not decode..."); ++errorsReported; if(!DEBUG) { println("outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize + " lastOutOffset=" + lastOutOffset + " lastInOffset=" + lastInOffset); } dfe.printStackTrace(); if(!testOnly) System.exit(0); else { println(" Testing mode, so continuing..."); //System.exit(0); break; } } } else if(blockType == BT_BZIP2) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_BZIP2 not currently supported."); ++errorsReported; if(!testOnly) System.exit(0); } else if(blockType == BT_COPY) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_COPY processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_COPY FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } dmgRaf.seek(/*lastOffs+*/inOffset); int bytesRead = dmgRaf.read(inBuffer, 0, Math.min((int)inSize, inBuffer.length)); long totalBytesRead = bytesRead; while(bytesRead != -1) { reportFilePointerProgress(dmgRaf); if(!testOnly) isoRaf.write(inBuffer, 0, bytesRead); if(totalBytesRead >= inSize) break; bytesRead = dmgRaf.read(inBuffer, 0, Math.min((int)(inSize-totalBytesRead), inBuffer.length)); if(bytesRead > 0) totalBytesRead += bytesRead; } //lastInOffs = inOffset+inSize; } else if(blockType == BT_ZERO) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZERO processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZERO FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } reportFilePointerProgress(dmgRaf); long numberOfZeroBlocks = outSize/zeroblock.length; int numberOfRemainingBytes = (int)(outSize%zeroblock.length); for(int j = 0; j < numberOfZeroBlocks; ++j) { if(!testOnly) isoRaf.write(zeroblock); } if(!testOnly) isoRaf.write(zeroblock, 0, numberOfRemainingBytes); //lastInOffs = inOffset+inSize; } else if(blockType == BT_ZERO2) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZERO2 processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZERO2 FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } reportFilePointerProgress(dmgRaf); long numberOfZeroBlocks = outSize/zeroblock.length; int numberOfRemainingBytes = (int)(outSize%zeroblock.length); for(int j = 0; j < numberOfZeroBlocks; ++j) { if(!testOnly) isoRaf.write(zeroblock); } if(!testOnly) isoRaf.write(zeroblock, 0, numberOfRemainingBytes); //lastInOffs = inOffset+inSize; } else if(blockType == BT_UNKNOWN) { /* I have no idea what this blocktype is... but it's common, and usually doesn't appear more than 2-3 times in a dmg. As long as its input and output sizes are 0, there's no reason to complain... is there? */ if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_UNKNOWN processing..."); if(!(inSize == 0 && outSize == 0)) { println(" " + elementNumber + ":" + blockCount + ". WARNING: Blocktype BT_UNKNOWN had non-zero sizes...", " inSize=" + inSize + ", outSize=" + outSize); ++warningsReported; //println(" The author of the program would be pleased if you contacted him about this."); // ...or would I? } } else if(blockType == BT_END) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_END processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_END FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); //lastOffs += lastInOffs; lastOutOffset = outOffset; lastInOffset += lastByteReadInBlock; } else { println(" " + elementNumber + ":" + blockCount + ". WARNING: previously unseen blocktype " + blockType + " [0x" + Integer.toHexString(blockType) + "]", " " + elementNumber + ":" + blockCount + ". outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize); ++warningsReported; if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". unknown blocktype FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); } offset += 0x28; ++blockCount; } } ++elementNumber; } //printlnVerbose("Progress: 100% Done!"); reportProgress(100); String summary = (errorsReported != 0)?errorsReported+" errors reported":"No errors reported"; summary += (warningsReported != 0)?" ("+warningsReported+" warnings emitted).":"."; if(!graphical) { newline(); println(summary); printlnVerbose("Total extracted bytes: " + totalSize + " B"); } else { progmon.close(); JOptionPane.showMessageDialog(null, "Extraction complete! " + summary + "\n" + "Total extracted bytes: " + totalSize + " B", "Information", JOptionPane.INFORMATION_MESSAGE); System.exit(0); } if(!DEBUG) { if(isoRaf != null) isoRaf.close(); dmgRaf.close(); } else { if(isoRaf != null) isoRaf.close();// System.out.println("blocks.size()=" + blocks.size());// for(DMGBlock b : blocks)// System.out.println(" " + b.toString()); LinkedList<DMGBlock> merged = mergeBlocks(blocks);// System.out.println("merged.size()=" + merged.size());// for(DMGBlock b : merged)// System.out.println(" " + b.toString()); println("Extracting all the parts not containing block data from source file:"); int i = 1; DMGBlock previous = null; for(DMGBlock b : merged) { if(previous == null && b.inOffset > 0) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(0); byte[] data = new byte[(int)(b.inOffset)]; dmgRaf.read(data); curFos.write(data); curFos.close(); } else if(previous != null) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(previous.inOffset+previous.inSize); byte[] data = new byte[(int)(b.inOffset-(previous.inOffset+previous.inSize))]; dmgRaf.read(data); curFos.write(data); curFos.close(); } previous = b; } if(previous.inOffset+previous.inSize != dmgRaf.length()) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(previous.inOffset+previous.inSize); byte[] data = new byte[(int)(dmgRaf.length()-(previous.inOffset+previous.inSize))]; dmgRaf.read(data); curFos.write(data); curFos.close(); } dmgRaf.close(); System.out.println("done!"); } }
public static void notmain(String[] args) throws Exception { if(DEBUG) verbose = true; parseArgs(args); printlnVerbose("Processing: " + dmgFile); RandomAccessFile dmgRaf = new RandomAccessFile(dmgFile, "r"); RandomAccessFile isoRaf = null; boolean testOnly = false; if(isoFile != null) { isoRaf = new RandomAccessFile(isoFile, "rw"); isoRaf.setLength(0); printlnVerbose("Extracting to: " + isoFile); } else { testOnly = true; printlnVerbose("Simulating extraction..."); } dmgRaf.seek(dmgRaf.length()-PLIST_ADDRESS_1); long plistBegin1 = dmgRaf.readLong(); long plistEnd = dmgRaf.readLong(); dmgRaf.seek(dmgRaf.length()-PLIST_ADDRESS_2); long plistBegin2 = dmgRaf.readLong(); long plistSize = dmgRaf.readLong(); if(DEBUG) { println("Read addresses:", " " + plistBegin1, " " + plistBegin2); } if(plistBegin1 != plistBegin2) { println("Addresses not equal! Assumption broken... =/", plistBegin1 + " != " + plistBegin2); System.exit(0); } if(plistSize != (plistEnd-plistBegin1)) { println("plistSize field does not match plistEnd marker!", "plistSize=" + plistSize + " plistBegin1=" + plistBegin1 + " plistEnd=" + plistEnd + " plistEnd-plistBegin1=" + (plistEnd-plistBegin1)); } printlnVerbose("Jumping to address..."); dmgRaf.seek(plistBegin1); byte[] buffer = new byte[(int)plistSize]; dmgRaf.read(buffer); InputStream is = new ByteArrayInputStream(buffer); NodeBuilder handler = new NodeBuilder(); SAXParser saxParser = SAXParserFactory.newInstance().newSAXParser(); try {// System.out.println("validation: " + saxParser.getProperty("validation"));// System.out.println("external-general-entities: " + saxParser.getProperty("external-general-entities"));// System.out.println("external-parameter-entities: " + saxParser.getProperty("external-parameter-entities"));// System.out.println("is-standalone: " + saxParser.getProperty("is-standalone"));// System.out.println("lexical-handler: " + saxParser.getProperty("lexical-handler"));// System.out.println("parameter-entities: " + saxParser.getProperty("parameter-entities"));// System.out.println("namespaces: " + saxParser.getProperty("namespaces"));// System.out.println("namespace-prefixes: " + saxParser.getProperty("namespace-prefixes"));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty("")); //System.out.println("isValidating: " + saxParser.isValidating()); saxParser.parse(is, handler); } catch(SAXException se) { se.printStackTrace(); System.err.println("Could not read the partition list... exiting."); System.exit(1); } XMLNode[] rootNodes = handler.getRoots(); if(rootNodes.length != 1) { println("Could not parse DMG-file!"); System.exit(0); } /* Ok, now we have a tree built from the XML-document. Let's walk to the right place. */ /* cd plist cd dict cdkey resource-fork (type:dict) cdkey blkx (type:array) */ XMLNode current; XMLElement[] children; boolean keyFound; current = rootNodes[0]; //We are at plist... probably (there should be only one root node) current = current.cd("dict"); current = current.cdkey("resource-fork"); current = current.cdkey("blkx"); printlnVerbose("Found " + current.getChildren().length + " partitions:"); byte[] inBuffer = new byte[0x40000]; byte[] outBuffer = new byte[0x40000]; byte[] zeroblock = new byte[4096]; /* I think java always zeroes its arrays on creation... but let's play safe. */ for(int y = 0; y < zeroblock.length; ++y) zeroblock[y] = 0; LinkedList<DMGBlock> blocks = new LinkedList<DMGBlock>(); long elementNumber = 0; //long lastOffs = 0; long lastOutOffset = 0; long lastInOffset = 0; long totalSize = 0; int errorsReported = 0; int warningsReported = 0; reportProgress(0); for(XMLElement xe : current.getChildren()) { if(progmon != null && progmon.isCanceled()) System.exit(0); if(xe instanceof XMLNode) { XMLNode xn = (XMLNode)xe; byte[] data = Base64.decode(xn.getKeyValue("Data")); long partitionSize = calculatePartitionSize(data); totalSize += partitionSize; printlnVerbose(" " + xn.getKeyValue("Name")); printlnVerbose(" ID: " + xn.getKeyValue("ID")); printlnVerbose(" Attributes: " + xn.getKeyValue("Attributes")); printlnVerbose(" Partition map data length: " + data.length + " bytes"); printlnVerbose(" Partition size: " + partitionSize + " bytes"); if(verbose) { printlnVerbose(" Dumping blkx..."); FileOutputStream fos = new FileOutputStream(xn.getKeyValue("ID") + ".blkx"); fos.write(data); fos.close(); } if(DEBUG) { File dumpFile = new File("data " + xn.getKeyValue("ID") + ".bin"); println(" Dumping partition map to file: " + dumpFile); FileOutputStream dump = new FileOutputStream(dumpFile); dump.write(data); dump.close(); } int offset = 0xCC; int blockType = 0; /* Offset of the input data for the current block in the input file */ long inOffset = 0; /* Size of the input data for the current block */ long inSize = 0; /* Offset of the output data for the current block in the output file */ long outOffset = 0; /* Size of the output data (possibly larger than inSize because of decompression, zero expansion...) */ long outSize = 0; long lastByteReadInBlock = -1; boolean addInOffset = false; //, lastInOffs = 0; int blockCount = 0; while(blockType != BT_END) { if(progmon != null && progmon.isCanceled()) System.exit(0); DataInputStream dis = new DataInputStream(new ByteArrayInputStream(data)); int bytesSkipped = 0; while(bytesSkipped < offset) bytesSkipped += dis.skipBytes(offset-bytesSkipped); blockType = dis.readInt(); int skipped = dis.readInt(); //Skip 4 bytes forward outOffset = dis.readLong()*0x200;//(dis.readInt() & 0xffffffffL)*0x200; //unsigned int -> long //dis.readInt(); //Skip 4 bytes forward outSize = dis.readLong()*0x200;//(dis.readInt() & 0xffffffffL)*0x200; //unsigned int -> long inOffset = dis.readLong();// & 0xffffffffL; //unsigned int -> long //dis.readInt(); //Skip 4 bytes forward inSize = dis.readLong();//dis.readInt() & 0xffffffffL; //unsigned int -> long if(lastByteReadInBlock == -1) lastByteReadInBlock = inOffset; lastByteReadInBlock += inSize; /* The lines below are a "hack" that I had to do to make dmgx work with certain dmg-files. I don't understand the issue at all, which is why this hack is here, but sometimes inOffset == 0 means that it is 0 relative to the previous partition's last inOffset. And sometimes it doesn't (meaning the actual position 0 in the dmg file). */ if(addInOffset) { if(DEBUG) println("!-----addInOffset mode: inOffset tranformation " + inOffset + "->" + (inOffset+lastInOffset)); inOffset += lastInOffset; } else if(inOffset == 0) { if(DEBUG) println("!-----Detected inOffset == 0, setting to " + lastInOffset); addInOffset = true; inOffset = lastInOffset; } outOffset += lastOutOffset; DMGBlock currentBlock = new DMGBlock(blockType, skipped, outOffset, outSize, inOffset, inSize); blocks.add(currentBlock); if(DEBUG) { println("outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize + " lastOutOffset=" + lastOutOffset + " lastInOffset=" + lastInOffset /*+ " lastInOffs=" + lastInOffs + " lastOffs=" + lastOffs*/); } if(blockType == BT_ADC) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_ADC not supported."); ++errorsReported; if(!testOnly) System.exit(0); } else if(blockType == BT_ZLIB) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZLIB processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZLIB FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); try { DMGBlockHandlers.processZlibBlock(currentBlock, dmgRaf, isoRaf, testOnly, dummyMonitor); } catch(DataFormatException dfe) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_ZLIB Could not decode..."); ++errorsReported; if(!DEBUG) { println("outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize + " lastOutOffset=" + lastOutOffset + " lastInOffset=" + lastInOffset); } dfe.printStackTrace(); if(!testOnly) System.exit(0); else { println(" Testing mode, so continuing..."); //System.exit(0); break; } } } else if(blockType == BT_BZIP2) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_BZIP2 not currently supported."); ++errorsReported; if(!testOnly) System.exit(0); } else if(blockType == BT_COPY) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_COPY processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_COPY FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } dmgRaf.seek(/*lastOffs+*/inOffset); int bytesRead = dmgRaf.read(inBuffer, 0, Math.min((int)inSize, inBuffer.length)); long totalBytesRead = bytesRead; while(bytesRead != -1) { reportFilePointerProgress(dmgRaf); if(!testOnly) isoRaf.write(inBuffer, 0, bytesRead); if(totalBytesRead >= inSize) break; bytesRead = dmgRaf.read(inBuffer, 0, Math.min((int)(inSize-totalBytesRead), inBuffer.length)); if(bytesRead > 0) totalBytesRead += bytesRead; } //lastInOffs = inOffset+inSize; } else if(blockType == BT_ZERO) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZERO processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZERO FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } reportFilePointerProgress(dmgRaf); long numberOfZeroBlocks = outSize/zeroblock.length; int numberOfRemainingBytes = (int)(outSize%zeroblock.length); for(int j = 0; j < numberOfZeroBlocks; ++j) { if(!testOnly) isoRaf.write(zeroblock); } if(!testOnly) isoRaf.write(zeroblock, 0, numberOfRemainingBytes); //lastInOffs = inOffset+inSize; } else if(blockType == BT_ZERO2) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZERO2 processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZERO2 FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } reportFilePointerProgress(dmgRaf); long numberOfZeroBlocks = outSize/zeroblock.length; int numberOfRemainingBytes = (int)(outSize%zeroblock.length); for(int j = 0; j < numberOfZeroBlocks; ++j) { if(!testOnly) isoRaf.write(zeroblock); } if(!testOnly) isoRaf.write(zeroblock, 0, numberOfRemainingBytes); //lastInOffs = inOffset+inSize; } else if(blockType == BT_UNKNOWN) { /* I have no idea what this blocktype is... but it's common, and usually doesn't appear more than 2-3 times in a dmg. As long as its input and output sizes are 0, there's no reason to complain... is there? */ if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_UNKNOWN processing..."); if(!(inSize == 0 && outSize == 0)) { println(" " + elementNumber + ":" + blockCount + ". WARNING: Blocktype BT_UNKNOWN had non-zero sizes...", " inSize=" + inSize + ", outSize=" + outSize); ++warningsReported; //println(" The author of the program would be pleased if you contacted him about this."); // ...or would I? } } else if(blockType == BT_END) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_END processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_END FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); //lastOffs += lastInOffs; lastOutOffset = outOffset; lastInOffset += lastByteReadInBlock; } else { println(" " + elementNumber + ":" + blockCount + ". WARNING: previously unseen blocktype " + blockType + " [0x" + Integer.toHexString(blockType) + "]", " " + elementNumber + ":" + blockCount + ". outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize); ++warningsReported; if(!testOnly && isoRaf.getFilePointer() != outOffset) println("!------>WARNING: unknown blocktype FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); } offset += 0x28; ++blockCount; } } ++elementNumber; } //printlnVerbose("Progress: 100% Done!"); reportProgress(100); String summary = (errorsReported != 0)?errorsReported+" errors reported":"No errors reported"; summary += (warningsReported != 0)?" ("+warningsReported+" warnings emitted).":"."; if(!graphical) { newline(); println(summary); printlnVerbose("Total extracted bytes: " + totalSize + " B"); } else { progmon.close(); JOptionPane.showMessageDialog(null, "Extraction complete! " + summary + "\n" + "Total extracted bytes: " + totalSize + " B", "Information", JOptionPane.INFORMATION_MESSAGE); System.exit(0); } if(!DEBUG) { if(isoRaf != null) isoRaf.close(); dmgRaf.close(); } else { if(isoRaf != null) isoRaf.close();// System.out.println("blocks.size()=" + blocks.size());// for(DMGBlock b : blocks)// System.out.println(" " + b.toString()); LinkedList<DMGBlock> merged = mergeBlocks(blocks);// System.out.println("merged.size()=" + merged.size());// for(DMGBlock b : merged)// System.out.println(" " + b.toString()); println("Extracting all the parts not containing block data from source file:"); int i = 1; DMGBlock previous = null; for(DMGBlock b : merged) { if(previous == null && b.inOffset > 0) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(0); byte[] data = new byte[(int)(b.inOffset)]; dmgRaf.read(data); curFos.write(data); curFos.close(); } else if(previous != null) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(previous.inOffset+previous.inSize); byte[] data = new byte[(int)(b.inOffset-(previous.inOffset+previous.inSize))]; dmgRaf.read(data); curFos.write(data); curFos.close(); } previous = b; } if(previous.inOffset+previous.inSize != dmgRaf.length()) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(previous.inOffset+previous.inSize); byte[] data = new byte[(int)(dmgRaf.length()-(previous.inOffset+previous.inSize))]; dmgRaf.read(data); curFos.write(data); curFos.close(); } dmgRaf.close(); System.out.println("done!"); } }
1,114,678
public static void notmain(String[] args) throws Exception { if(DEBUG) verbose = true; parseArgs(args); printlnVerbose("Processing: " + dmgFile); RandomAccessFile dmgRaf = new RandomAccessFile(dmgFile, "r"); RandomAccessFile isoRaf = null; boolean testOnly = false; if(isoFile != null) { isoRaf = new RandomAccessFile(isoFile, "rw"); isoRaf.setLength(0); printlnVerbose("Extracting to: " + isoFile); } else { testOnly = true; printlnVerbose("Simulating extraction..."); } dmgRaf.seek(dmgRaf.length()-PLIST_ADDRESS_1); long plistBegin1 = dmgRaf.readLong(); long plistEnd = dmgRaf.readLong(); dmgRaf.seek(dmgRaf.length()-PLIST_ADDRESS_2); long plistBegin2 = dmgRaf.readLong(); long plistSize = dmgRaf.readLong(); if(DEBUG) { println("Read addresses:", " " + plistBegin1, " " + plistBegin2); } if(plistBegin1 != plistBegin2) { println("Addresses not equal! Assumption broken... =/", plistBegin1 + " != " + plistBegin2); System.exit(0); } if(plistSize != (plistEnd-plistBegin1)) { println("plistSize field does not match plistEnd marker!", "plistSize=" + plistSize + " plistBegin1=" + plistBegin1 + " plistEnd=" + plistEnd + " plistEnd-plistBegin1=" + (plistEnd-plistBegin1)); } printlnVerbose("Jumping to address..."); dmgRaf.seek(plistBegin1); byte[] buffer = new byte[(int)plistSize]; dmgRaf.read(buffer); InputStream is = new ByteArrayInputStream(buffer); NodeBuilder handler = new NodeBuilder(); SAXParser saxParser = SAXParserFactory.newInstance().newSAXParser(); try {// System.out.println("validation: " + saxParser.getProperty("validation"));// System.out.println("external-general-entities: " + saxParser.getProperty("external-general-entities"));// System.out.println("external-parameter-entities: " + saxParser.getProperty("external-parameter-entities"));// System.out.println("is-standalone: " + saxParser.getProperty("is-standalone"));// System.out.println("lexical-handler: " + saxParser.getProperty("lexical-handler"));// System.out.println("parameter-entities: " + saxParser.getProperty("parameter-entities"));// System.out.println("namespaces: " + saxParser.getProperty("namespaces"));// System.out.println("namespace-prefixes: " + saxParser.getProperty("namespace-prefixes"));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty("")); //System.out.println("isValidating: " + saxParser.isValidating()); saxParser.parse(is, handler); } catch(SAXException se) { se.printStackTrace(); System.err.println("Could not read the partition list... exiting."); System.exit(1); } XMLNode[] rootNodes = handler.getRoots(); if(rootNodes.length != 1) { println("Could not parse DMG-file!"); System.exit(0); } /* Ok, now we have a tree built from the XML-document. Let's walk to the right place. */ /* cd plist cd dict cdkey resource-fork (type:dict) cdkey blkx (type:array) */ XMLNode current; XMLElement[] children; boolean keyFound; current = rootNodes[0]; //We are at plist... probably (there should be only one root node) current = current.cd("dict"); current = current.cdkey("resource-fork"); current = current.cdkey("blkx"); printlnVerbose("Found " + current.getChildren().length + " partitions:"); byte[] inBuffer = new byte[0x40000]; byte[] outBuffer = new byte[0x40000]; byte[] zeroblock = new byte[4096]; /* I think java always zeroes its arrays on creation... but let's play safe. */ for(int y = 0; y < zeroblock.length; ++y) zeroblock[y] = 0; LinkedList<DMGBlock> blocks = new LinkedList<DMGBlock>(); long elementNumber = 0; //long lastOffs = 0; long lastOutOffset = 0; long lastInOffset = 0; long totalSize = 0; int errorsReported = 0; int warningsReported = 0; reportProgress(0); for(XMLElement xe : current.getChildren()) { if(progmon != null && progmon.isCanceled()) System.exit(0); if(xe instanceof XMLNode) { XMLNode xn = (XMLNode)xe; byte[] data = Base64.decode(xn.getKeyValue("Data")); long partitionSize = calculatePartitionSize(data); totalSize += partitionSize; printlnVerbose(" " + xn.getKeyValue("Name")); printlnVerbose(" ID: " + xn.getKeyValue("ID")); printlnVerbose(" Attributes: " + xn.getKeyValue("Attributes")); printlnVerbose(" Partition map data length: " + data.length + " bytes"); printlnVerbose(" Partition size: " + partitionSize + " bytes"); if(verbose) { printlnVerbose(" Dumping blkx..."); FileOutputStream fos = new FileOutputStream(xn.getKeyValue("ID") + ".blkx"); fos.write(data); fos.close(); } if(DEBUG) { File dumpFile = new File("data " + xn.getKeyValue("ID") + ".bin"); println(" Dumping partition map to file: " + dumpFile); FileOutputStream dump = new FileOutputStream(dumpFile); dump.write(data); dump.close(); } int offset = 0xCC; int blockType = 0; /* Offset of the input data for the current block in the input file */ long inOffset = 0; /* Size of the input data for the current block */ long inSize = 0; /* Offset of the output data for the current block in the output file */ long outOffset = 0; /* Size of the output data (possibly larger than inSize because of decompression, zero expansion...) */ long outSize = 0; long lastByteReadInBlock = -1; boolean addInOffset = false; //, lastInOffs = 0; int blockCount = 0; while(blockType != BT_END) { if(progmon != null && progmon.isCanceled()) System.exit(0); DataInputStream dis = new DataInputStream(new ByteArrayInputStream(data)); int bytesSkipped = 0; while(bytesSkipped < offset) bytesSkipped += dis.skipBytes(offset-bytesSkipped); blockType = dis.readInt(); int skipped = dis.readInt(); //Skip 4 bytes forward outOffset = dis.readLong()*0x200;//(dis.readInt() & 0xffffffffL)*0x200; //unsigned int -> long //dis.readInt(); //Skip 4 bytes forward outSize = dis.readLong()*0x200;//(dis.readInt() & 0xffffffffL)*0x200; //unsigned int -> long inOffset = dis.readLong();// & 0xffffffffL; //unsigned int -> long //dis.readInt(); //Skip 4 bytes forward inSize = dis.readLong();//dis.readInt() & 0xffffffffL; //unsigned int -> long if(lastByteReadInBlock == -1) lastByteReadInBlock = inOffset; lastByteReadInBlock += inSize; /* The lines below are a "hack" that I had to do to make dmgx work with certain dmg-files. I don't understand the issue at all, which is why this hack is here, but sometimes inOffset == 0 means that it is 0 relative to the previous partition's last inOffset. And sometimes it doesn't (meaning the actual position 0 in the dmg file). */ if(addInOffset) { if(DEBUG) println("!-----addInOffset mode: inOffset tranformation " + inOffset + "->" + (inOffset+lastInOffset)); inOffset += lastInOffset; } else if(inOffset == 0) { if(DEBUG) println("!-----Detected inOffset == 0, setting to " + lastInOffset); addInOffset = true; inOffset = lastInOffset; } outOffset += lastOutOffset; DMGBlock currentBlock = new DMGBlock(blockType, skipped, outOffset, outSize, inOffset, inSize); blocks.add(currentBlock); if(DEBUG) { println("outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize + " lastOutOffset=" + lastOutOffset + " lastInOffset=" + lastInOffset /*+ " lastInOffs=" + lastInOffs + " lastOffs=" + lastOffs*/); } if(blockType == BT_ADC) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_ADC not supported."); ++errorsReported; if(!testOnly) System.exit(0); } else if(blockType == BT_ZLIB) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZLIB processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZLIB FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); try { DMGBlockHandlers.processZlibBlock(currentBlock, dmgRaf, isoRaf, testOnly, dummyMonitor); } catch(DataFormatException dfe) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_ZLIB Could not decode..."); ++errorsReported; if(!DEBUG) { println("outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize + " lastOutOffset=" + lastOutOffset + " lastInOffset=" + lastInOffset); } dfe.printStackTrace(); if(!testOnly) System.exit(0); else { println(" Testing mode, so continuing..."); //System.exit(0); break; } } } else if(blockType == BT_BZIP2) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_BZIP2 not currently supported."); ++errorsReported; if(!testOnly) System.exit(0); } else if(blockType == BT_COPY) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_COPY processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_COPY FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } dmgRaf.seek(/*lastOffs+*/inOffset); int bytesRead = dmgRaf.read(inBuffer, 0, Math.min((int)inSize, inBuffer.length)); long totalBytesRead = bytesRead; while(bytesRead != -1) { reportFilePointerProgress(dmgRaf); if(!testOnly) isoRaf.write(inBuffer, 0, bytesRead); if(totalBytesRead >= inSize) break; bytesRead = dmgRaf.read(inBuffer, 0, Math.min((int)(inSize-totalBytesRead), inBuffer.length)); if(bytesRead > 0) totalBytesRead += bytesRead; } //lastInOffs = inOffset+inSize; } else if(blockType == BT_ZERO) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZERO processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZERO FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } reportFilePointerProgress(dmgRaf); long numberOfZeroBlocks = outSize/zeroblock.length; int numberOfRemainingBytes = (int)(outSize%zeroblock.length); for(int j = 0; j < numberOfZeroBlocks; ++j) { if(!testOnly) isoRaf.write(zeroblock); } if(!testOnly) isoRaf.write(zeroblock, 0, numberOfRemainingBytes); //lastInOffs = inOffset+inSize; } else if(blockType == BT_ZERO2) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZERO2 processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZERO2 FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } reportFilePointerProgress(dmgRaf); long numberOfZeroBlocks = outSize/zeroblock.length; int numberOfRemainingBytes = (int)(outSize%zeroblock.length); for(int j = 0; j < numberOfZeroBlocks; ++j) { if(!testOnly) isoRaf.write(zeroblock); } if(!testOnly) isoRaf.write(zeroblock, 0, numberOfRemainingBytes); //lastInOffs = inOffset+inSize; } else if(blockType == BT_UNKNOWN) { /* I have no idea what this blocktype is... but it's common, and usually doesn't appear more than 2-3 times in a dmg. As long as its input and output sizes are 0, there's no reason to complain... is there? */ if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_UNKNOWN processing..."); if(!(inSize == 0 && outSize == 0)) { println(" " + elementNumber + ":" + blockCount + ". WARNING: Blocktype BT_UNKNOWN had non-zero sizes...", " inSize=" + inSize + ", outSize=" + outSize); ++warningsReported; //println(" The author of the program would be pleased if you contacted him about this."); // ...or would I? } } else if(blockType == BT_END) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_END processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_END FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); //lastOffs += lastInOffs; lastOutOffset = outOffset; lastInOffset += lastByteReadInBlock; } else { println(" " + elementNumber + ":" + blockCount + ". WARNING: previously unseen blocktype " + blockType + " [0x" + Integer.toHexString(blockType) + "]", " " + elementNumber + ":" + blockCount + ". outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize); ++warningsReported; if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". unknown blocktype FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); } offset += 0x28; ++blockCount; } } ++elementNumber; } //printlnVerbose("Progress: 100% Done!"); reportProgress(100); String summary = (errorsReported != 0)?errorsReported+" errors reported":"No errors reported"; summary += (warningsReported != 0)?" ("+warningsReported+" warnings emitted).":"."; if(!graphical) { newline(); println(summary); printlnVerbose("Total extracted bytes: " + totalSize + " B"); } else { progmon.close(); JOptionPane.showMessageDialog(null, "Extraction complete! " + summary + "\n" + "Total extracted bytes: " + totalSize + " B", "Information", JOptionPane.INFORMATION_MESSAGE); System.exit(0); } if(!DEBUG) { if(isoRaf != null) isoRaf.close(); dmgRaf.close(); } else { if(isoRaf != null) isoRaf.close();// System.out.println("blocks.size()=" + blocks.size());// for(DMGBlock b : blocks)// System.out.println(" " + b.toString()); LinkedList<DMGBlock> merged = mergeBlocks(blocks);// System.out.println("merged.size()=" + merged.size());// for(DMGBlock b : merged)// System.out.println(" " + b.toString()); println("Extracting all the parts not containing block data from source file:"); int i = 1; DMGBlock previous = null; for(DMGBlock b : merged) { if(previous == null && b.inOffset > 0) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(0); byte[] data = new byte[(int)(b.inOffset)]; dmgRaf.read(data); curFos.write(data); curFos.close(); } else if(previous != null) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(previous.inOffset+previous.inSize); byte[] data = new byte[(int)(b.inOffset-(previous.inOffset+previous.inSize))]; dmgRaf.read(data); curFos.write(data); curFos.close(); } previous = b; } if(previous.inOffset+previous.inSize != dmgRaf.length()) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(previous.inOffset+previous.inSize); byte[] data = new byte[(int)(dmgRaf.length()-(previous.inOffset+previous.inSize))]; dmgRaf.read(data); curFos.write(data); curFos.close(); } dmgRaf.close(); System.out.println("done!"); } }
public static void notmain(String[] args) throws Exception { if(DEBUG) verbose = true; parseArgs(args); printlnVerbose("Processing: " + dmgFile); RandomAccessFile dmgRaf = new RandomAccessFile(dmgFile, "r"); RandomAccessFile isoRaf = null; boolean testOnly = false; if(isoFile != null) { isoRaf = new RandomAccessFile(isoFile, "rw"); isoRaf.setLength(0); printlnVerbose("Extracting to: " + isoFile); } else { testOnly = true; printlnVerbose("Simulating extraction..."); } dmgRaf.seek(dmgRaf.length()-PLIST_ADDRESS_1); long plistBegin1 = dmgRaf.readLong(); long plistEnd = dmgRaf.readLong(); dmgRaf.seek(dmgRaf.length()-PLIST_ADDRESS_2); long plistBegin2 = dmgRaf.readLong(); long plistSize = dmgRaf.readLong(); if(DEBUG) { println("Read addresses:", " " + plistBegin1, " " + plistBegin2); } if(plistBegin1 != plistBegin2) { println("Addresses not equal! Assumption broken... =/", plistBegin1 + " != " + plistBegin2); System.exit(0); } if(plistSize != (plistEnd-plistBegin1)) { println("plistSize field does not match plistEnd marker!", "plistSize=" + plistSize + " plistBegin1=" + plistBegin1 + " plistEnd=" + plistEnd + " plistEnd-plistBegin1=" + (plistEnd-plistBegin1)); } printlnVerbose("Jumping to address..."); dmgRaf.seek(plistBegin1); byte[] buffer = new byte[(int)plistSize]; dmgRaf.read(buffer); InputStream is = new ByteArrayInputStream(buffer); NodeBuilder handler = new NodeBuilder(); SAXParser saxParser = SAXParserFactory.newInstance().newSAXParser(); try {// System.out.println("validation: " + saxParser.getProperty("validation"));// System.out.println("external-general-entities: " + saxParser.getProperty("external-general-entities"));// System.out.println("external-parameter-entities: " + saxParser.getProperty("external-parameter-entities"));// System.out.println("is-standalone: " + saxParser.getProperty("is-standalone"));// System.out.println("lexical-handler: " + saxParser.getProperty("lexical-handler"));// System.out.println("parameter-entities: " + saxParser.getProperty("parameter-entities"));// System.out.println("namespaces: " + saxParser.getProperty("namespaces"));// System.out.println("namespace-prefixes: " + saxParser.getProperty("namespace-prefixes"));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println(": " + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty(""));// System.out.println("" + saxParser.getProperty("")); //System.out.println("isValidating: " + saxParser.isValidating()); saxParser.parse(is, handler); } catch(SAXException se) { se.printStackTrace(); System.err.println("Could not read the partition list... exiting."); System.exit(1); } XMLNode[] rootNodes = handler.getRoots(); if(rootNodes.length != 1) { println("Could not parse DMG-file!"); System.exit(0); } /* Ok, now we have a tree built from the XML-document. Let's walk to the right place. */ /* cd plist cd dict cdkey resource-fork (type:dict) cdkey blkx (type:array) */ XMLNode current; XMLElement[] children; boolean keyFound; current = rootNodes[0]; //We are at plist... probably (there should be only one root node) current = current.cd("dict"); current = current.cdkey("resource-fork"); current = current.cdkey("blkx"); printlnVerbose("Found " + current.getChildren().length + " partitions:"); byte[] inBuffer = new byte[0x40000]; byte[] outBuffer = new byte[0x40000]; byte[] zeroblock = new byte[4096]; /* I think java always zeroes its arrays on creation... but let's play safe. */ for(int y = 0; y < zeroblock.length; ++y) zeroblock[y] = 0; LinkedList<DMGBlock> blocks = new LinkedList<DMGBlock>(); long elementNumber = 0; //long lastOffs = 0; long lastOutOffset = 0; long lastInOffset = 0; long totalSize = 0; int errorsReported = 0; int warningsReported = 0; reportProgress(0); for(XMLElement xe : current.getChildren()) { if(progmon != null && progmon.isCanceled()) System.exit(0); if(xe instanceof XMLNode) { XMLNode xn = (XMLNode)xe; byte[] data = Base64.decode(xn.getKeyValue("Data")); long partitionSize = calculatePartitionSize(data); totalSize += partitionSize; printlnVerbose(" " + xn.getKeyValue("Name")); printlnVerbose(" ID: " + xn.getKeyValue("ID")); printlnVerbose(" Attributes: " + xn.getKeyValue("Attributes")); printlnVerbose(" Partition map data length: " + data.length + " bytes"); printlnVerbose(" Partition size: " + partitionSize + " bytes"); if(verbose) { printlnVerbose(" Dumping blkx..."); FileOutputStream fos = new FileOutputStream(xn.getKeyValue("ID") + ".blkx"); fos.write(data); fos.close(); } if(DEBUG) { File dumpFile = new File("data " + xn.getKeyValue("ID") + ".bin"); println(" Dumping partition map to file: " + dumpFile); FileOutputStream dump = new FileOutputStream(dumpFile); dump.write(data); dump.close(); } int offset = 0xCC; int blockType = 0; /* Offset of the input data for the current block in the input file */ long inOffset = 0; /* Size of the input data for the current block */ long inSize = 0; /* Offset of the output data for the current block in the output file */ long outOffset = 0; /* Size of the output data (possibly larger than inSize because of decompression, zero expansion...) */ long outSize = 0; long lastByteReadInBlock = -1; boolean addInOffset = false; //, lastInOffs = 0; int blockCount = 0; while(blockType != BT_END) { if(progmon != null && progmon.isCanceled()) System.exit(0); DataInputStream dis = new DataInputStream(new ByteArrayInputStream(data)); int bytesSkipped = 0; while(bytesSkipped < offset) bytesSkipped += dis.skipBytes(offset-bytesSkipped); blockType = dis.readInt(); int skipped = dis.readInt(); //Skip 4 bytes forward outOffset = dis.readLong()*0x200;//(dis.readInt() & 0xffffffffL)*0x200; //unsigned int -> long //dis.readInt(); //Skip 4 bytes forward outSize = dis.readLong()*0x200;//(dis.readInt() & 0xffffffffL)*0x200; //unsigned int -> long inOffset = dis.readLong();// & 0xffffffffL; //unsigned int -> long //dis.readInt(); //Skip 4 bytes forward inSize = dis.readLong();//dis.readInt() & 0xffffffffL; //unsigned int -> long if(lastByteReadInBlock == -1) lastByteReadInBlock = inOffset; lastByteReadInBlock += inSize; /* The lines below are a "hack" that I had to do to make dmgx work with certain dmg-files. I don't understand the issue at all, which is why this hack is here, but sometimes inOffset == 0 means that it is 0 relative to the previous partition's last inOffset. And sometimes it doesn't (meaning the actual position 0 in the dmg file). */ if(addInOffset) { if(DEBUG) println("!-----addInOffset mode: inOffset tranformation " + inOffset + "->" + (inOffset+lastInOffset)); inOffset += lastInOffset; } else if(inOffset == 0) { if(DEBUG) println("!-----Detected inOffset == 0, setting to " + lastInOffset); addInOffset = true; inOffset = lastInOffset; } outOffset += lastOutOffset; DMGBlock currentBlock = new DMGBlock(blockType, skipped, outOffset, outSize, inOffset, inSize); blocks.add(currentBlock); if(DEBUG) { println("outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize + " lastOutOffset=" + lastOutOffset + " lastInOffset=" + lastInOffset /*+ " lastInOffs=" + lastInOffs + " lastOffs=" + lastOffs*/); } if(blockType == BT_ADC) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_ADC not supported."); ++errorsReported; if(!testOnly) System.exit(0); } else if(blockType == BT_ZLIB) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZLIB processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZLIB FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); try { DMGBlockHandlers.processZlibBlock(currentBlock, dmgRaf, isoRaf, testOnly, dummyMonitor); } catch(DataFormatException dfe) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_ZLIB Could not decode..."); ++errorsReported; if(!debug) { println("outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize + " lastOutOffset=" + lastOutOffset + " lastInOffset=" + lastInOffset); } dfe.printStackTrace(); if(!testOnly) System.exit(0); else { println(" Testing mode, so continuing..."); //System.exit(0); break; } } } else if(blockType == BT_BZIP2) { println(" " + elementNumber + ":" + blockCount + ". ERROR: BT_BZIP2 not currently supported."); ++errorsReported; if(!testOnly) System.exit(0); } else if(blockType == BT_COPY) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_COPY processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_COPY FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } dmgRaf.seek(/*lastOffs+*/inOffset); int bytesRead = dmgRaf.read(inBuffer, 0, Math.min((int)inSize, inBuffer.length)); long totalBytesRead = bytesRead; while(bytesRead != -1) { reportFilePointerProgress(dmgRaf); if(!testOnly) isoRaf.write(inBuffer, 0, bytesRead); if(totalBytesRead >= inSize) break; bytesRead = dmgRaf.read(inBuffer, 0, Math.min((int)(inSize-totalBytesRead), inBuffer.length)); if(bytesRead > 0) totalBytesRead += bytesRead; } //lastInOffs = inOffset+inSize; } else if(blockType == BT_ZERO) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZERO processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZERO FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } reportFilePointerProgress(dmgRaf); long numberOfZeroBlocks = outSize/zeroblock.length; int numberOfRemainingBytes = (int)(outSize%zeroblock.length); for(int j = 0; j < numberOfZeroBlocks; ++j) { if(!testOnly) isoRaf.write(zeroblock); } if(!testOnly) isoRaf.write(zeroblock, 0, numberOfRemainingBytes); //lastInOffs = inOffset+inSize; } else if(blockType == BT_ZERO2) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_ZERO2 processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) { println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_ZERO2 FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); ++warningsReported; } reportFilePointerProgress(dmgRaf); long numberOfZeroBlocks = outSize/zeroblock.length; int numberOfRemainingBytes = (int)(outSize%zeroblock.length); for(int j = 0; j < numberOfZeroBlocks; ++j) { if(!testOnly) isoRaf.write(zeroblock); } if(!testOnly) isoRaf.write(zeroblock, 0, numberOfRemainingBytes); //lastInOffs = inOffset+inSize; } else if(blockType == BT_UNKNOWN) { /* I have no idea what this blocktype is... but it's common, and usually doesn't appear more than 2-3 times in a dmg. As long as its input and output sizes are 0, there's no reason to complain... is there? */ if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_UNKNOWN processing..."); if(!(inSize == 0 && outSize == 0)) { println(" " + elementNumber + ":" + blockCount + ". WARNING: Blocktype BT_UNKNOWN had non-zero sizes...", " inSize=" + inSize + ", outSize=" + outSize); ++warningsReported; //println(" The author of the program would be pleased if you contacted him about this."); // ...or would I? } } else if(blockType == BT_END) { if(DEBUG) println(" " + elementNumber + ":" + blockCount + ". BT_END processing..."); if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". WARNING: BT_END FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); //lastOffs += lastInOffs; lastOutOffset = outOffset; lastInOffset += lastByteReadInBlock; } else { println(" " + elementNumber + ":" + blockCount + ". WARNING: previously unseen blocktype " + blockType + " [0x" + Integer.toHexString(blockType) + "]", " " + elementNumber + ":" + blockCount + ". outOffset=" + outOffset + " outSize=" + outSize + " inOffset=" + inOffset + " inSize=" + inSize); ++warningsReported; if(!testOnly && isoRaf.getFilePointer() != outOffset) println(" " + elementNumber + ":" + blockCount + ". unknown blocktype FP != outOffset (" + isoRaf.getFilePointer() + " != " + outOffset + ")"); } offset += 0x28; ++blockCount; } } ++elementNumber; } //printlnVerbose("Progress: 100% Done!"); reportProgress(100); String summary = (errorsReported != 0)?errorsReported+" errors reported":"No errors reported"; summary += (warningsReported != 0)?" ("+warningsReported+" warnings emitted).":"."; if(!graphical) { newline(); println(summary); printlnVerbose("Total extracted bytes: " + totalSize + " B"); } else { progmon.close(); JOptionPane.showMessageDialog(null, "Extraction complete! " + summary + "\n" + "Total extracted bytes: " + totalSize + " B", "Information", JOptionPane.INFORMATION_MESSAGE); System.exit(0); } if(!debug) { if(isoRaf != null) isoRaf.close(); dmgRaf.close(); } else { if(isoRaf != null) isoRaf.close();// System.out.println("blocks.size()=" + blocks.size());// for(DMGBlock b : blocks)// System.out.println(" " + b.toString()); LinkedList<DMGBlock> merged = mergeBlocks(blocks);// System.out.println("merged.size()=" + merged.size());// for(DMGBlock b : merged)// System.out.println(" " + b.toString()); println("Extracting all the parts not containing block data from source file:"); int i = 1; DMGBlock previous = null; for(DMGBlock b : merged) { if(previous == null && b.inOffset > 0) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(0); byte[] data = new byte[(int)(b.inOffset)]; dmgRaf.read(data); curFos.write(data); curFos.close(); } else if(previous != null) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(previous.inOffset+previous.inSize); byte[] data = new byte[(int)(b.inOffset-(previous.inOffset+previous.inSize))]; dmgRaf.read(data); curFos.write(data); curFos.close(); } previous = b; } if(previous.inOffset+previous.inSize != dmgRaf.length()) { String filename = i++ + ".block"; println(" " + new File(filename).getCanonicalPath() + "..."); FileOutputStream curFos = new FileOutputStream(new File(filename)); dmgRaf.seek(previous.inOffset+previous.inSize); byte[] data = new byte[(int)(dmgRaf.length()-(previous.inOffset+previous.inSize))]; dmgRaf.read(data); curFos.write(data); curFos.close(); } dmgRaf.close(); System.out.println("done!"); } }
1,114,679
public static void parseArgs(String[] args) { boolean parseSuccessful = false; try { /* Take care of the options... */ int i; for(i = 0; i < args.length; ++i) { String cur = args[i]; if(!cur.startsWith("-")) break; else if(cur.equals("-gui")) { graphical = true; // This should be moved to UI class in the future. System.setProperty("swing.aatext", "true"); //Antialiased text try { javax.swing.UIManager.setLookAndFeel(javax.swing.UIManager.getSystemLookAndFeelClassName()); } catch(Exception e) {} } else if(cur.equals("-v")) verbose = true; else if(cur.equals("-startupcommand")) { startupCommand = args[i+1]; ++i; } } println(APPNAME + " " + BUILDSTRING, "Copyright (c) 2006 Erik Larsson <erik82@kth.se>", " based upon dmg2iso, Copyright (c) 2004 vu1tur <v@vu1tur.eu.org>", " also using the iHarder Base64 Encoder/Decoder <http://iharder.sf.net>", "", "This program is distributed under the GNU General Public License version 2 or", "later. See <http://www.gnu.org/copyleft/gpl.html> for the details.", ""); if(i == args.length) { dmgFile = getInputFileFromUser(); if(dmgFile == null) System.exit(0); if(getOutputConfirmationFromUser()) { isoFile = getOutputFileFromUser(); if(isoFile == null) System.exit(0); } } else { dmgFile = new File(args[i++]); if(!dmgFile.exists()) { println("File \"" + dmgFile + "\" could not be found!"); System.exit(0); } if(i == args.length-1) isoFile = new File(args[i]); else if(i != args.length) throw new Exception(); } parseSuccessful = true; } catch(Exception e) { println(); println(" usage: " + startupCommand + " [options] <dmgFile> [<isoFile>]"); println(" if an iso-file is not supplied, the program will simulate an extraction"); println(" (useful for detecting errors in dmg-files)"); println(); System.exit(0); } }
public static void parseArgs(String[] args) { boolean parseSuccessful = false; try { /* Take care of the options... */ int i; for(i = 0; i < args.length; ++i) { String cur = args[i]; if(!cur.startsWith("-")) break; else if(cur.equals("-gui")) { graphical = true; // This should be moved to UI class in the future. System.setProperty("swing.aatext", "true"); //Antialiased text try { javax.swing.UIManager.setLookAndFeel(javax.swing.UIManager.getSystemLookAndFeelClassName()); } catch(Exception e) {} } else if(cur.equals("-v")) verbose = true; else if(cur.equals("-startupcommand")) { startupCommand = args[i+1]; ++i; } } println(APPNAME + " " + BUILDSTRING, "Copyright (c) 2006 Erik Larsson <erik82@kth.se>", " based on dmg2iso, Copyright (c) 2004 vu1tur <v@vu1tur.eu.org>", " also using the iHarder Base64 Encoder/Decoder <http://iharder.sf.net>", "", "This program is distributed under the GNU General Public License version 2 or", "later. See <http://www.gnu.org/copyleft/gpl.html> for the details.", ""); if(i == args.length) { dmgFile = getInputFileFromUser(); if(dmgFile == null) System.exit(0); if(getOutputConfirmationFromUser()) { isoFile = getOutputFileFromUser(); if(isoFile == null) System.exit(0); } } else { dmgFile = new File(args[i++]); if(!dmgFile.exists()) { println("File \"" + dmgFile + "\" could not be found!"); System.exit(0); } if(i == args.length-1) isoFile = new File(args[i]); else if(i != args.length) throw new Exception(); } parseSuccessful = true; } catch(Exception e) { println(); println(" usage: " + startupCommand + " [options] <dmgFile> [<isoFile>]"); println(" if an iso-file is not supplied, the program will simulate an extraction"); println(" (useful for detecting errors in dmg-files)"); println(); System.exit(0); } }
1,114,680
static void notifyKeyRequestAccepted(final UUID artifactUniqueId, final JabberId acceptedBy) { final InternalDocumentModel iDocumentModel = DocumentModel.getInternalModel(sContext); try { final Document document = iDocumentModel.get(artifactUniqueId); iDocumentModel.unlock(document.getId()); SystemMessageModel.getInternalModel(sContext). createKeyResponse(document.getId(), Boolean.TRUE, acceptedBy); } catch(ParityException px) { sLogger.fatal("Could not accept key request.", px); return; } }
static void notifyKeyRequestAccepted(final UUID artifactUniqueId, final JabberId acceptedBy) { final InternalDocumentModel iDModel = DocumentModel.getInternalModel(sContext); try { final Document document = iDocumentModel.get(artifactUniqueId); iDocumentModel.unlock(document.getId()); SystemMessageModel.getInternalModel(sContext). createKeyResponse(document.getId(), Boolean.TRUE, acceptedBy); } catch(ParityException px) { sLogger.fatal("Could not accept key request.", px); return; } }
1,114,681
static void notifyKeyRequestAccepted(final UUID artifactUniqueId, final JabberId acceptedBy) { final InternalDocumentModel iDocumentModel = DocumentModel.getInternalModel(sContext); try { final Document document = iDocumentModel.get(artifactUniqueId); iDocumentModel.unlock(document.getId()); SystemMessageModel.getInternalModel(sContext). createKeyResponse(document.getId(), Boolean.TRUE, acceptedBy); } catch(ParityException px) { sLogger.fatal("Could not accept key request.", px); return; } }
static void notifyKeyRequestAccepted(final UUID artifactUniqueId, final JabberId acceptedBy) { final InternalDocumentModel iDocumentModel = DocumentModel.getInternalModel(sContext); try { final Document document = iDocumentModel.get(artifactUniqueId); iDocumentModel.unlock(document.getId()); SystemMessageModel.getInternalModel(sContext). createKeyResponse(document.getId(), Boolean.TRUE, acceptedBy); } catch(ParityException px) { sLogger.fatal("Could not accept key request.", px); return; } }
1,114,682
void sendKeyResponse(final Long documentId, final JabberId requestedBy, final KeyResponse keyResponse) throws ParityException { logger.info("sendKeyResponse(UUID,User,KeyResponse)"); logger.debug(documentId); logger.debug(requestedBy); logger.debug(keyResponse); assertLoggedInUserIsKeyHolder(documentId); synchronized(SessionModelImpl.xmppHelperLock) { try { // NOTE This should be refactored when the session can be changed. final User requestedByUser = new User(requestedBy.getQualifiedJabberId()); final InternalDocumentModel iDModel = getInternalDocumentModel(); final Document document = iDModel.get(documentId); // if the user sends an acceptance of the key request; we // want to send the latest version to the requesting user switch(keyResponse) { case ACCEPT: // create the new version final DocumentVersion version = iDModel.createVersion(documentId); // send the key change to the server xmppHelper.sendKeyResponse( document.getUniqueId(), keyResponse, requestedByUser); // send new version final Collection<User> users = new Vector<User>(1); users.add(requestedByUser); send(users, documentId, version.getVersionId()); // lock the local document iDModel.lock(documentId); // audit send key final DocumentVersion dv = iDModel.getVersion( version.getArtifactId(), version.getVersionId()); auditor.sendKey(dv.getArtifactId(), dv.getVersionId(), xmppHelper.getUser().getId(), version.getUpdatedOn(), requestedBy); break; case DENY: // send the declination to the server xmppHelper.sendKeyResponse( document.getUniqueId(), KeyResponse.DENY, requestedByUser); break; default: throw Assert.createUnreachable("Unknown key response: " + keyResponse); } } catch(final SmackException sx) { logger.error("sendKeyResponse(Document,User,KeyResponse)", sx); throw ParityErrorTranslator.translate(sx); } catch(final RuntimeException rx) { logger.error("sendKeyResponse(Document,User,KeyResponse)", rx); throw ParityErrorTranslator.translate(rx); } } }
void sendKeyResponse(final Long documentId, final JabberId requestedBy, final KeyResponse keyResponse) throws ParityException { logger.info("sendKeyResponse(UUID,User,KeyResponse)"); logger.debug(documentId); logger.debug(requestedBy); logger.debug(keyResponse); assertLoggedInUserIsKeyHolder(documentId); synchronized(SessionModelImpl.xmppHelperLock) { try { // NOTE This should be refactored when the session can be changed. final User requestedByUser = new User(requestedBy.getQualifiedJabberId()); final InternalDocumentModel iDModel = getInternalDocumentModel(); final Document document = iDModel.get(documentId); // if the user sends an acceptance of the key request; we // want to send the latest version to the requesting user switch(keyResponse) { case ACCEPT: // create the new version final DocumentVersion version; if(iDModel.isWorkingVersionEqual(documentId)) { version = iDModel.getLatestVersion(documentId); } else { version = iDModel.createVersion(documentId); } // send the key change to the server xmppHelper.sendKeyResponse( document.getUniqueId(), keyResponse, requestedByUser); // send new version final Collection<User> users = new Vector<User>(1); users.add(requestedByUser); send(users, documentId, version.getVersionId()); // lock the local document iDModel.lock(documentId); // audit send key final DocumentVersion dv = iDModel.getVersion( version.getArtifactId(), version.getVersionId()); auditor.sendKey(dv.getArtifactId(), dv.getVersionId(), xmppHelper.getUser().getId(), version.getUpdatedOn(), requestedBy); break; case DENY: // send the declination to the server xmppHelper.sendKeyResponse( document.getUniqueId(), KeyResponse.DENY, requestedByUser); break; default: throw Assert.createUnreachable("Unknown key response: " + keyResponse); } } catch(final SmackException sx) { logger.error("sendKeyResponse(Document,User,KeyResponse)", sx); throw ParityErrorTranslator.translate(sx); } catch(final RuntimeException rx) { logger.error("sendKeyResponse(Document,User,KeyResponse)", rx); throw ParityErrorTranslator.translate(rx); } } }
1,114,684
void sendKeyResponse(final Long documentId, final JabberId requestedBy, final KeyResponse keyResponse) throws ParityException { logger.info("sendKeyResponse(UUID,User,KeyResponse)"); logger.debug(documentId); logger.debug(requestedBy); logger.debug(keyResponse); assertLoggedInUserIsKeyHolder(documentId); synchronized(SessionModelImpl.xmppHelperLock) { try { // NOTE This should be refactored when the session can be changed. final User requestedByUser = new User(requestedBy.getQualifiedJabberId()); final InternalDocumentModel iDModel = getInternalDocumentModel(); final Document document = iDModel.get(documentId); // if the user sends an acceptance of the key request; we // want to send the latest version to the requesting user switch(keyResponse) { case ACCEPT: // create the new version final DocumentVersion version = iDModel.createVersion(documentId); // send the key change to the server xmppHelper.sendKeyResponse( document.getUniqueId(), keyResponse, requestedByUser); // send new version final Collection<User> users = new Vector<User>(1); users.add(requestedByUser); send(users, documentId, version.getVersionId()); // lock the local document iDModel.lock(documentId); // audit send key final DocumentVersion dv = iDModel.getVersion( version.getArtifactId(), version.getVersionId()); auditor.sendKey(dv.getArtifactId(), dv.getVersionId(), xmppHelper.getUser().getId(), version.getUpdatedOn(), requestedBy); break; case DENY: // send the declination to the server xmppHelper.sendKeyResponse( document.getUniqueId(), KeyResponse.DENY, requestedByUser); break; default: throw Assert.createUnreachable("Unknown key response: " + keyResponse); } } catch(final SmackException sx) { logger.error("sendKeyResponse(Document,User,KeyResponse)", sx); throw ParityErrorTranslator.translate(sx); } catch(final RuntimeException rx) { logger.error("sendKeyResponse(Document,User,KeyResponse)", rx); throw ParityErrorTranslator.translate(rx); } } }
void sendKeyResponse(final Long documentId, final JabberId requestedBy, final KeyResponse keyResponse) throws ParityException { logger.info("sendKeyResponse(UUID,User,KeyResponse)"); logger.debug(documentId); logger.debug(requestedBy); logger.debug(keyResponse); assertLoggedInUserIsKeyHolder(documentId); synchronized(SessionModelImpl.xmppHelperLock) { try { // NOTE This should be refactored when the session can be changed. final User requestedByUser = new User(requestedBy.getQualifiedJabberId()); final InternalDocumentModel iDModel = getInternalDocumentModel(); final Document document = iDModel.get(documentId); // if the user sends an acceptance of the key request; we // want to send the latest version to the requesting user switch(keyResponse) { case ACCEPT: // create the new version final DocumentVersion version = iDModel.createVersion(documentId); // send the key change to the server xmppHelper.sendKeyResponse( document.getUniqueId(), keyResponse, requestedByUser); // send new version final Collection<User> users = new Vector<User>(1); users.add(requestedByUser); send(users, documentId, version.getVersionId()); // lock the local document iDModel.lock(documentId); // audit send key final DocumentVersion dv = iDModel.getVersion( version.getArtifactId(), version.getVersionId()); auditor.sendKey(dv.getArtifactId(), dv.getVersionId(), xmppHelper.getUser().getId(), currentDateTime(), requestedBy); break; case DENY: // send the declination to the server xmppHelper.sendKeyResponse( document.getUniqueId(), KeyResponse.DENY, requestedByUser); break; default: throw Assert.createUnreachable("Unknown key response: " + keyResponse); } } catch(final SmackException sx) { logger.error("sendKeyResponse(Document,User,KeyResponse)", sx); throw ParityErrorTranslator.translate(sx); } catch(final RuntimeException rx) { logger.error("sendKeyResponse(Document,User,KeyResponse)", rx); throw ParityErrorTranslator.translate(rx); } } }
1,114,685
public void init( ServletConfig config ) throws ServletException { super.init( config ); /* * setup the toolbox if there is one */ String key = config.getInitParameter( TOOLBOX_PARAM ); if ( key != null ) { InputStream is = null; try { /* * little fix up */ if ( !key.startsWith("/") ) { key = "/" + key; } /* * get the bits */ is = getServletContext().getResourceAsStream( key ); if ( is != null) { Velocity.info("Using toolbox configuration file '" + key +"'"); toolboxManager = new ServletToolboxManager(getServletContext()); toolboxManager.load( is ); Velocity.info("Toolbox setup complete."); } } catch( Exception e ) { Velocity.error("Problem reading toolbox file properties file '" + key +"' : " + e ); } finally { try { if ( is != null) is.close(); } catch(Exception ee ) {} } } else { Velocity.info("No toolbox entry in configuration."); } }
public void init( ServletConfig config ) throws ServletException { super.init( config ); /* * setup the toolbox if there is one */ String key = config.getInitParameter( TOOLBOX_PARAM ); if (key == null || key.length() == 0) { InputStream is = null; try { /* * little fix up */ if ( !key.startsWith("/") ) { key = "/" + key; } /* * get the bits */ is = getServletContext().getResourceAsStream( key ); if ( is != null) { Velocity.info("Using toolbox configuration file '" + key +"'"); toolboxManager = new ServletToolboxManager(getServletContext()); toolboxManager.load( is ); Velocity.info("Toolbox setup complete."); } } catch( Exception e ) { Velocity.error("Problem reading toolbox file properties file '" + key +"' : " + e ); } finally { try { if ( is != null) is.close(); } catch(Exception ee ) {} } } else { Velocity.info("No toolbox entry in configuration."); } }
1,114,687
public void init( ServletConfig config ) throws ServletException { super.init( config ); /* * setup the toolbox if there is one */ String key = config.getInitParameter( TOOLBOX_PARAM ); if ( key != null ) { InputStream is = null; try { /* * little fix up */ if ( !key.startsWith("/") ) { key = "/" + key; } /* * get the bits */ is = getServletContext().getResourceAsStream( key ); if ( is != null) { Velocity.info("Using toolbox configuration file '" + key +"'"); toolboxManager = new ServletToolboxManager(getServletContext()); toolboxManager.load( is ); Velocity.info("Toolbox setup complete."); } } catch( Exception e ) { Velocity.error("Problem reading toolbox file properties file '" + key +"' : " + e ); } finally { try { if ( is != null) is.close(); } catch(Exception ee ) {} } } else { Velocity.info("No toolbox entry in configuration."); } }
public void init( ServletConfig config ) throws ServletException { super.init( config ); /* * setup the toolbox if there is one */ String key = config.getInitParameter( TOOLBOX_PARAM ); if ( key != null ) { key = servletContext.getInitParameter(TOOLBOX_PARAM); } try { /* * little fix up */ if ( !key.startsWith("/") ) { key = "/" + key; } /* * get the bits */ is = getServletContext().getResourceAsStream( key ); if ( is != null) { Velocity.info("Using toolbox configuration file '" + key +"'"); toolboxManager = new ServletToolboxManager(getServletContext()); toolboxManager.load( is ); Velocity.info("Toolbox setup complete."); } } catch( Exception e ) { Velocity.error("Problem reading toolbox file properties file '" + key +"' : " + e ); } finally { try { if ( is != null) is.close(); } catch(Exception ee ) {} } } else { Velocity.info("No toolbox entry in configuration."); } }
1,114,688
public void init( ServletConfig config ) throws ServletException { super.init( config ); /* * setup the toolbox if there is one */ String key = config.getInitParameter( TOOLBOX_PARAM ); if ( key != null ) { InputStream is = null; try { /* * little fix up */ if ( !key.startsWith("/") ) { key = "/" + key; } /* * get the bits */ is = getServletContext().getResourceAsStream( key ); if ( is != null) { Velocity.info("Using toolbox configuration file '" + key +"'"); toolboxManager = new ServletToolboxManager(getServletContext()); toolboxManager.load( is ); Velocity.info("Toolbox setup complete."); } } catch( Exception e ) { Velocity.error("Problem reading toolbox file properties file '" + key +"' : " + e ); } finally { try { if ( is != null) is.close(); } catch(Exception ee ) {} } } else { Velocity.info("No toolbox entry in configuration."); } }
public void init( ServletConfig config ) throws ServletException { super.init( config ); /* * setup the toolbox if there is one */ String key = config.getInitParameter( TOOLBOX_PARAM ); if ( key != null ) { InputStream is = null; try { /* * little fix up */ if ( !key.startsWith("/") ) { key = "/" + key; } /* * get the bits */ is = getServletContext().getResourceAsStream( key ); if ( is != null) { Velocity.info("Using toolbox configuration file '" + key +"'"); toolboxManager = new ServletToolboxManager(getServletContext()); toolboxManager.load( is ); Velocity.info("Toolbox setup complete."); } } catch( Exception e ) { Velocity.error("Problem reading toolbox file properties file '" + key +"' : " + e ); } finally { try { if ( is != null) is.close(); } catch(Exception ee ) {} } } else { Velocity.info("No toolbox entry in configuration."); } }
1,114,689
public ServletToolboxManager(ServletContext servletContext) { this.servletContext = servletContext; appTools = new HashMap(); sessionToolInfo = new ArrayList(); requestToolInfo = new ArrayList(); createSession = true; }
private ServletToolboxManager(ServletContext servletContext) { this.servletContext = servletContext; appTools = new HashMap(); sessionToolInfo = new ArrayList(); requestToolInfo = new ArrayList(); createSession = true; }
1,114,690
private Fixture(final StreamServer streamServer, final OutputStream stream, final String streamId, final StreamSession streamSession) { super(); this.streamServer = streamServer; this.stream = stream; this.streamId = streamId; this.streamSession = streamSession; }
private Fixture(final StreamServer streamServer, final OutputStream stream, final String streamId, final StreamSession streamSession) { super(); this.streamServer = streamServer; this.stream = stream; this.streamId = streamId; this.streamSession = streamSession; }
1,114,691
private Fixture(final StreamServer streamServer, final OutputStream stream, final String streamId, final StreamSession streamSession) { super(); this.streamServer = streamServer; this.stream = stream; this.streamId = streamId; this.streamSession = streamSession; }
private Fixture(final StreamServer streamServer, final OutputStream stream, final String streamId, final StreamSession streamSession) { super(); this.streamServer = streamServer; this.streamId = streamId; this.streamSession = streamSession; }
1,114,692
protected void setUp() throws Exception { super.setUp(); final File workingDirectory = new File(getOutputDirectory(), "working"); Assert.assertTrue(workingDirectory.mkdir(), "Could not create directory {0}.", workingDirectory); final File streamFile = getInputFiles()[0]; final StreamServer server = startStreamServer(DesdemonaTestUser.JUNIT, workingDirectory); final StreamSession session = createSession(DesdemonaTestUser.JUNIT, server); final String streamId = createStream(server, session, streamFile.getName()); final OutputStream stream = new FileOutputStream(new File(getOutputDirectory(), streamFile.getName())); seedServer(server, session, streamId, 0L, streamFile); datum = new Fixture(server, stream, streamId, session); }
protected void setUp() throws Exception { super.setUp(); final File workingDirectory = new File(getOutputDirectory(), "working"); Assert.assertTrue(workingDirectory.mkdir(), "Could not create directory {0}.", workingDirectory); final File inputFile = getInputFiles()[0]; final File outputFile = new File(getOutputDirectory(), inputFile.getName()); final StreamServer server = startStreamServer(DesdemonaTestUser.JUNIT, workingDirectory); final StreamSession session = createSession(DesdemonaTestUser.JUNIT, server); final String streamId = createStream(server, session, streamFile.getName()); final OutputStream stream = new FileOutputStream(new File(getOutputDirectory(), streamFile.getName())); seedServer(server, session, streamId, 0L, streamFile); datum = new Fixture(server, stream, streamId, session); }
1,114,694
protected void setUp() throws Exception { super.setUp(); final File workingDirectory = new File(getOutputDirectory(), "working"); Assert.assertTrue(workingDirectory.mkdir(), "Could not create directory {0}.", workingDirectory); final File streamFile = getInputFiles()[0]; final StreamServer server = startStreamServer(DesdemonaTestUser.JUNIT, workingDirectory); final StreamSession session = createSession(DesdemonaTestUser.JUNIT, server); final String streamId = createStream(server, session, streamFile.getName()); final OutputStream stream = new FileOutputStream(new File(getOutputDirectory(), streamFile.getName())); seedServer(server, session, streamId, 0L, streamFile); datum = new Fixture(server, stream, streamId, session); }
protected void setUp() throws Exception { super.setUp(); final File workingDirectory = new File(getOutputDirectory(), "working"); Assert.assertTrue(workingDirectory.mkdir(), "Could not create directory {0}.", workingDirectory); final File streamFile = getInputFiles()[0]; final StreamServer server = startStreamServer(DesdemonaTestUser.JUNIT, workingDirectory); final StreamSession session = createSession(DesdemonaTestUser.JUNIT, server); final String streamId = createStream(server, session, streamFile.getName()); final OutputStream stream = new FileOutputStream(new File(getOutputDirectory(), streamFile.getName())); seedServer(server, session, streamId, 0L, streamFile); datum = new Fixture(server, stream, streamId, session); }
1,114,695
public void testReader() { final StreamReader reader = new StreamReader(datum.streamSession); try { reader.open(); reader.read(datum.streamId, datum.stream); } catch (final IOException iox) { fail(createFailMessage(iox)); } finally { try { datum.stream.close(); reader.close(); } catch (final IOException iox2) { fail(createFailMessage(iox2)); } } }
public void testReader() { final StreamReader reader = new StreamReader(datum.streamSession); try { reader.open(); reader.read(datum.streamId, datum.stream); } catch (final IOException iox) { fail(createFailMessage(iox)); } finally { try { datum.stream.close(); reader.close(); } catch (final IOException iox2) { fail(createFailMessage(iox2)); } } }
1,114,696
public void testReader() { final StreamReader reader = new StreamReader(datum.streamSession); try { reader.open(); reader.read(datum.streamId, datum.stream); } catch (final IOException iox) { fail(createFailMessage(iox)); } finally { try { datum.stream.close(); reader.close(); } catch (final IOException iox2) { fail(createFailMessage(iox2)); } } }
public void testReader() { final StreamReader reader = new StreamReader(datum.streamSession); try { reader.open(); reader.read(datum.streamId, datum.stream); } catch (final IOException iox) { fail(createFailMessage(iox)); } assertEquals(datum.outputFile.length(), datum.inputFile.length()); try { final InputStream downloadInputStream = new FileInputStream(datum.outputFile); String downloadChecksum; try { datum.stream.close(); reader.close(); } catch (final IOException iox2) { fail(createFailMessage(iox2)); } } }
1,114,697
public void testReader() { final StreamReader reader = new StreamReader(datum.streamSession); try { reader.open(); reader.read(datum.streamId, datum.stream); } catch (final IOException iox) { fail(createFailMessage(iox)); } finally { try { datum.stream.close(); reader.close(); } catch (final IOException iox2) { fail(createFailMessage(iox2)); } } }
public void testReader() { final StreamReader reader = new StreamReader(datum.streamSession); try { reader.open(); reader.read(datum.streamId, datum.stream); } catch (final IOException iox) { fail(createFailMessage(iox)); } finally { try { datum.stream.close(); reader.close(); } catch (final IOException iox2) { fail(createFailMessage(iox2)); } } }
1,114,698
protected ManageableCollection doGetCollection(Session session, Node parentNode, CollectionDescriptor collectionDescriptor, Class collectionFieldClass) throws RepositoryException { Mapper mapper = collectionDescriptor.getClassDescriptor().getMappingDescriptor().getMapper(); ClassDescriptor elementClassDescriptor = mapper.getClassDescriptor( ReflectionUtils.forName(collectionDescriptor.getElementClassName())); ManageableCollection collection = ManageableCollectionUtil.getManageableCollection(collectionFieldClass); Class elementClass = ReflectionUtils.forName(collectionDescriptor.getElementClassName()); Iterator children = this.getCollectionNodes(session, parentNode, elementClassDescriptor.getJcrNodeType()).iterator(); while (children.hasNext()) { Node itemNode = (Node) children.next(); log.debug("Collection node found : " + itemNode.getPath()); Object item = objectConverter.getObject(session, elementClass, itemNode.getPath()); collection.addObject(item); } return collection; }
protected ManageableCollection doGetCollection(Session session, Node parentNode, CollectionDescriptor collectionDescriptor, Class collectionFieldClass) throws RepositoryException { Mapper mapper = collectionDescriptor.getClassDescriptor().getMappingDescriptor().getMapper(); ClassDescriptor elementClassDescriptor = mapper.getClassDescriptor( ReflectionUtils.forName(collectionDescriptor.getElementClassName())); ManageableCollection collection = ManageableCollectionUtil.getManageableCollection(collectionFieldClass); Class elementClass = ReflectionUtils.forName(collectionDescriptor.getElementClassName()); Iterator children = this.getCollectionNodes(session, parentNode, elementClassDescriptor.getJcrNodeType()).iterator(); while (children.hasNext()) { Node itemNode = (Node) children.next(); log.debug("Collection node found : " + itemNode.getPath()); Object item = objectConverter.getObject(session, elementClass, itemNode.getPath()); collection.addObject(item); } return collection; }
1,114,700
protected void doInsertCollection(Session session, Node parentNode, CollectionDescriptor collectionDescriptor, ManageableCollection collection) { if (collection == null) { return; } Mapper mapper = collectionDescriptor.getClassDescriptor().getMappingDescriptor().getMapper(); ClassDescriptor elementClassDescriptor = mapper.getClassDescriptor( ReflectionUtils.forName(collectionDescriptor.getElementClassName())); Iterator collectionIterator = collection.getIterator(); int elementCollectionCount = 0; while (collectionIterator.hasNext()) { Object item = collectionIterator.next(); String elementJcrName = null; // If the element object has a unique id => the element jcr node name = the id value if (elementClassDescriptor.hasIdField()) { String idFieldName = elementClassDescriptor.getIdFieldDescriptor().getFieldName(); elementJcrName = ReflectionUtils.getNestedProperty(item, idFieldName).toString(); } else { elementCollectionCount++; elementJcrName = COLLECTION_ELEMENT_NAME + elementCollectionCount; } objectConverter.insert(session, parentNode, elementJcrName, item); } }
protected void doInsertCollection(Session session, Node parentNode, CollectionDescriptor collectionDescriptor, ManageableCollection collection) { if (collection == null) { return; } Mapper mapper = collectionDescriptor.getClassDescriptor().getMappingDescriptor().getMapper(); ClassDescriptor elementClassDescriptor = mapper.getClassDescriptor( ReflectionUtils.forName(collectionDescriptor.getElementClassName())); Iterator collectionIterator = collection.getIterator(); int elementCollectionCount = 0; while (collectionIterator.hasNext()) { Object item = collectionIterator.next(); String elementJcrName = null; // If the element object has a unique id => the element jcr node name = the id value if (elementClassDescriptor.hasIdField()) { String idFieldName = elementClassDescriptor.getIdFieldDescriptor().getFieldName(); elementJcrName = ReflectionUtils.getNestedProperty(item, idFieldName).toString(); } else { elementCollectionCount++; elementJcrName = COLLECTION_ELEMENT_NAME + elementCollectionCount; } objectConverter.insert(session, parentNode, elementJcrName, item); } }
1,114,701
protected void paintComponent(final Graphics g) { super.paintComponent(g); final Graphics2D g2 = (Graphics2D) g.create(); try { if (searchJTextField.hasFocus()) { final Point leftLocation = leftJLabel.getLocation(); g2.drawImage(Images.BrowserTitle.HALO, leftLocation.x - 1, leftLocation.y - 1, null); } else { final Point leftLocation = searchJTextField.getLocation(); g2.drawImage(Images.BrowserTitle.SEARCH_BACKGROUND, leftLocation.x, leftLocation.y + 1, null); } } finally { g2.dispose(); } }
protected void paintComponent(final Graphics g) { super.paintComponent(g); final Graphics2D g2 = (Graphics2D) g.create(); try { if (userActivated) { final Point leftLocation = leftJLabel.getLocation(); g2.drawImage(Images.BrowserTitle.HALO, leftLocation.x - 1, leftLocation.y - 1, null); } else { final Point leftLocation = searchJTextField.getLocation(); g2.drawImage(Images.BrowserTitle.SEARCH_BACKGROUND, leftLocation.x, leftLocation.y + 1, null); } } finally { g2.dispose(); } }
1,114,702
public void moveBrowserWindow(final Point l) { final Point newL = mainWindow.getLocation(); newL.x += l.x; newL.y += l.y; logger.debug(newL); mainWindow.setLocation(newL); }
public void moveBrowserWindow(final Point l) { final Point newL = mainWindow.getLocation(); newL.x += l.x; newL.y += l.y; mainWindow.setLocation(newL); }
1,114,707
public void selectDocument(final Long documentId) { session.setSelectedDocumentId(documentId); setInput(AvatarId.SESSION_SEND_FORM, documentId); }
public void selectDocument(final Long documentId) { session.setSelectedDocumentId(documentId); }
1,114,708
private void processQueue() { if (0 < getQueueTotal()) { synchronized (this) { TrayNotification notification; for (final Iterator<TrayNotification> i = queue.iterator(); i.hasNext();) { notification = i.next(); sysTray.display(notification); i.remove(); } } } }
private void processQueue() { if (0 < getQueueTotal()) { synchronized (this) { TrayNotification notification; for (final Iterator<TrayNotification> i = queue.iterator(); i.hasNext();) { notification = i.next(); sysTray.display(notification); i.remove(); } } } }
1,114,709
private void processQueue() { if (0 < getQueueTotal()) { synchronized (this) { TrayNotification notification; for (final Iterator<TrayNotification> i = queue.iterator(); i.hasNext();) { notification = i.next(); sysTray.display(notification); i.remove(); } } } }
private void processQueue() { if (0 < getQueueTotal()) { synchronized (this) { TrayNotification notification; for (final Iterator<TrayNotification> i = queue.iterator(); i.hasNext();) { notification = i.next(); NotifyPanel.display(notification); i.remove(); } } } }
1,114,710
public void addPacketListener(final PacketListener listener, final PacketFilter filter) { logger.logApiId(); logger.logVariable("listener", listener); logger.logVariable("filter", filter); xmppConnection.addPacketListener(listener, filter); }
public void addPacketListener(final PacketListener listener, final PacketFilter filter) { logger.logApiId(); logger.logVariable("listener", listener); logger.logVariable("filter", filter); xmppConnection.addPacketListener(listener, filter); }
1,114,712
public void clearListeners() { logger.logApiId(); listeners.clear(); logger.logTraceId(); xmppArtifact.clearListeners(); logger.logTraceId(); xmppContact.clearListeners(); logger.logTraceId(); xmppContainer.clearListeners(); logger.logTraceId(); xmppProfile.clearListeners(); logger.logTraceId(); xmppUser.clearListeners(); }
public void clearListeners() { logger.logApiId(); listeners.clear(); logger.logTraceId(); xmppArtifact.clearListeners(); logger.logTraceId(); xmppContact.clearListeners(); logger.logTraceId(); xmppContainer.clearListeners(); logger.logTraceId(); xmppProfile.clearListeners(); logger.logTraceId(); xmppUser.clearListeners(); }
1,114,713
public void clearListeners() { logger.logApiId(); listeners.clear(); logger.logTraceId(); xmppArtifact.clearListeners(); logger.logTraceId(); xmppContact.clearListeners(); logger.logTraceId(); xmppContainer.clearListeners(); logger.logTraceId(); xmppProfile.clearListeners(); logger.logTraceId(); xmppUser.clearListeners(); }
public void clearListeners() { logger.logApiId(); listeners.clear(); xmppBackup.clearListeners(); xmppArtifact.clearListeners(); xmppBackup.clearListeners(); xmppContact.clearListeners(); xmppBackup.clearListeners(); xmppContainer.clearListeners(); xmppBackup.clearListeners(); xmppProfile.clearListeners(); xmppBackup.clearListeners(); xmppUser.clearListeners(); }
1,114,714
public void clearListeners() { logger.logApiId(); listeners.clear(); logger.logTraceId(); xmppArtifact.clearListeners(); logger.logTraceId(); xmppContact.clearListeners(); logger.logTraceId(); xmppContainer.clearListeners(); logger.logTraceId(); xmppProfile.clearListeners(); logger.logTraceId(); xmppUser.clearListeners(); }
public void clearListeners() { logger.logApiId(); listeners.clear(); xmppArtifact.clearListeners(); xmppContact.clearListeners(); xmppContainer.clearListeners(); xmppProfile.clearListeners(); xmppUser.clearListeners(); }
1,114,715
public void clearListeners() { logger.logApiId(); listeners.clear(); logger.logTraceId(); xmppArtifact.clearListeners(); logger.logTraceId(); xmppContact.clearListeners(); logger.logTraceId(); xmppContainer.clearListeners(); logger.logTraceId(); xmppProfile.clearListeners(); logger.logTraceId(); xmppUser.clearListeners(); }
public void clearListeners() { logger.logApiId(); listeners.clear(); xmppStream.clearListeners(); xmppSystem.clearListeners(); xmppArtifact.clearListeners(); xmppStream.clearListeners(); xmppSystem.clearListeners(); xmppContact.clearListeners(); xmppStream.clearListeners(); xmppSystem.clearListeners(); xmppContainer.clearListeners(); xmppStream.clearListeners(); xmppSystem.clearListeners(); xmppProfile.clearListeners(); xmppStream.clearListeners(); xmppSystem.clearListeners(); xmppUser.clearListeners(); }
1,114,716
public void createDraft(final UUID uniqueId) { logger.logApiId(); logger.logVariable("uniqueId", uniqueId); xmppArtifact.createDraft(uniqueId); }
public void createDraft(final UUID uniqueId) { logger.logApiId(); logger.logVariable("uniqueId", uniqueId); xmppArtifact.createDraft(uniqueId); }
1,114,717
public Boolean isLoggedIn() { logger.logApiId(); return (null != xmppConnection && xmppConnection.isConnected() && xmppConnection.isAuthenticated()); }
public Boolean isLoggedIn() { logger.logApiId(); return null != xmppConnection && xmppConnection.isConnected() && xmppConnection.isAuthenticated()); }
1,114,719
public Boolean isLoggedIn() { logger.logApiId(); return (null != xmppConnection && xmppConnection.isConnected() && xmppConnection.isAuthenticated()); }
public Boolean isLoggedIn() { logger.logApiId(); return (null != xmppConnection && xmppConnection.isConnected() && xmppConnection.isAuthenticated() && null != xmppAnonymousConnection && xmppAnonymousConnection.isConnected() && xmppAnonymousConnection.isAuthenticated(); }
1,114,720
public void publish(ContainerVersion container, Map<DocumentVersion, String> documents, List<JabberId> publishTo, JabberId publishedBy, Calendar publishedOn) { try { xmppContainer.publish(container, documents, publishTo, publishedBy, publishedOn); } catch (final IOException iox) { throw translateError(iox); } }
public void publish(ContainerVersion container, Map<DocumentVersion, String> documents, List<JabberId> publishTo, JabberId publishedBy, Calendar publishedOn) { try { xmppContainer.publish(container, documents, publishTo, publishedBy, publishedOn); } catch (final IOException iox) { throw translateError(iox); } }
1,114,721
public boolean getCss2() { return getIe() && (getMac() && getMajorVersion() >= 5 || (getWin32() && getMajorVersion() >= 6) || getGecko() // && version >= ? || (getOpera() && getMajorVersion() >= 4) || (getSafari() && getMajorVersion() >= 2) || (getKonqueror() && getMajorVersion() >= 2); } public boolean getDom0() { return (getIe() && getMajorVersion() >= 3) || (getNetscape() && getMajorVersion() >= 2) || (getOpera() && getMajorVersion() >= 3) || getGecko() || getSafari() || getKonqueror(); }
public boolean getCss2() { return getIe() && (getMac() && getMajorVersion() >= 5) || (getWin32() && getMajorVersion() >= 6) || getGecko() // && version >= ? || (getOpera() && getMajorVersion() >= 4) || (getSafari() && getMajorVersion() >= 2) || (getKonqueror() && getMajorVersion() >= 2); } public boolean getDom0() { return (getIe() && getMajorVersion() >= 3) || (getNetscape() && getMajorVersion() >= 2) || (getOpera() && getMajorVersion() >= 3) || getGecko() || getSafari() || getKonqueror(); }
1,114,722
public boolean getCss2() { return getIe() && (getMac() && getMajorVersion() >= 5 || (getWin32() && getMajorVersion() >= 6) || getGecko() // && version >= ? || (getOpera() && getMajorVersion() >= 4) || (getSafari() && getMajorVersion() >= 2) || (getKonqueror() && getMajorVersion() >= 2); } public boolean getDom0() { return (getIe() && getMajorVersion() >= 3) || (getNetscape() && getMajorVersion() >= 2) || (getOpera() && getMajorVersion() >= 3) || getGecko() || getSafari() || getKonqueror(); }
public boolean getCss2() { return getIe() && (getMac() && getMajorVersion() >= 5 || (getWin32() && getMajorVersion() >= 6) || getGecko() || // && version >= ? || (getOpera() && getMajorVersion() >= 4) || (getSafari() && getMajorVersion() >= 2) || (getKonqueror() && getMajorVersion() >= 2); } public boolean getDom0() { return (getIe() && getMajorVersion() >= 3) || (getNetscape() && getMajorVersion() >= 2) || (getOpera() && getMajorVersion() >= 3) || getGecko() || || getSafari() || getKonqueror(); }
1,114,723
public boolean getCss2() { return getIe() && (getMac() && getMajorVersion() >= 5 || (getWin32() && getMajorVersion() >= 6) || getGecko() // && version >= ? || (getOpera() && getMajorVersion() >= 4) || (getSafari() && getMajorVersion() >= 2) || (getKonqueror() && getMajorVersion() >= 2); } public boolean getDom0() { return (getIe() && getMajorVersion() >= 3) || (getNetscape() && getMajorVersion() >= 2) || (getOpera() && getMajorVersion() >= 3) || getGecko() || getSafari() || getKonqueror(); }
public boolean getCss2() { return getIe() && (getMac() && getMajorVersion() >= 5 || (getWin32() && getMajorVersion() >= 6) || getGecko() // && version >= ? || (getOpera() && getMajorVersion() >= 4) || (getSafari() && getMajorVersion() >= 2) || (getKonqueror() && getMajorVersion() >= 2); } public boolean getDom0() { return (getIe() && getMajorVersion() >= 3) || (getNetscape() && getMajorVersion() >= 2) || (getOpera() && getMajorVersion() >= 3) || getGecko() || getSafari() || getKonqueror(); }
1,114,724
public String getBaseRef() { StringBuffer out = new StringBuffer(); out.append(getContextURL()); out.append(ServletUtils.getPath(request)); return out.toString(); }
public String getBaseRef() { StringBuffer out = new StringBuffer(); out.append(getContextURL()); out.append(getRequestPath()); return out.toString(); }
1,114,727
public String toString() { StringBuffer out = new StringBuffer(); if (uri != null) { out.append(uri); } String query = getQueryData(); if (query != null) { // Check if URI already contains query data if ( uri == null || uri.indexOf('?') < 0) { // no query data yet, start query data with '?' out.append('?'); } else { // there is already query data, use data delimiter out.append(queryDataDelim); } out.append(query); } if (anchor != null) { out.append('#'); out.append(encodeURL(anchor)); } // encode session ID into URL if sessions are used but cookies are // not supported return response.encodeURL(out.toString()); }
public String toString() { StringBuffer out = new StringBuffer(); if (uri != null) { out.append(uri); } String query = getQueryData(); if (query != null) { // Check if URI already contains query data if ( uri == null || uri.indexOf('?') < 0) { // no query data yet, start query data with '?' out.append('?'); } else { // there is already query data, use data delimiter out.append(queryDataDelim); } out.append(query); } if (anchor != null) { out.append('#'); out.append(encodeURL(anchor)); } // encode session ID into URL if sessions are used but cookies are // not supported String str = out.toString(); if (str.length() == 0) { return str; } else { return response.encodeURL(str); } }
1,114,728
public LinkTool setRelative(String uri) { if (uri.startsWith("/")) { return copyWith(request.getContextPath() + uri); } else { return copyWith(request.getContextPath() + '/' + uri); } }
public LinkTool setRelative(String uri) { if (uri.startsWith("/")) { return copyWith(ctxPath + uri); } else { return copyWith(request.getContextPath() + '/' + uri); } }
1,114,729
public LinkTool setRelative(String uri) { if (uri.startsWith("/")) { return copyWith(request.getContextPath() + uri); } else { return copyWith(request.getContextPath() + '/' + uri); } }
public LinkTool setRelative(String uri) { if (uri.startsWith("/")) { return copyWith(request.getContextPath() + uri); } else { return copyWith(request.getContextPath() + '/' + uri); } }
1,114,730
public IntTypeConverterImpl(ValueFactory factory) { super(factory); }
public IntTypeConverterImpl(ValueFactory factory) { super(factory); }
1,114,732
public void handleSessionTerminated(final Exception cause) { logApiId(); notifyListeners(new EventNotifier<SessionListener>() { public void notifyListener(final SessionListener listener) { listener.sessionTerminated(cause); } }); }
void handleSessionTerminated(final Exception cause) { logApiId(); notifyListeners(new EventNotifier<SessionListener>() { public void notifyListener(final SessionListener listener) { listener.sessionTerminated(cause); } }); }
1,114,735
public void addTeamMember(final UUID artifactUniqueId, final JabberId jabberId) throws SmackException;
public void addTeamMember(final UUID artifactUniqueId, final JabberId jabberId);
1,114,736
public void declineInvitation(final EMail invitedAs, final JabberId invitedBy) throws SmackException;
public void declineInvitation(final EMail invitedAs, final JabberId invitedBy);
1,114,737
public void login(final Environment environment, final Credentials credentials) throws SmackException;
public void login(final Environment environment, final Credentials credentials);
1,114,738
public void logout() throws SmackException;
public void logout();
1,114,739
public void publish(final ContainerVersion container, final Map<DocumentVersion, InputStream> documents, final List<JabberId> publishTo, final JabberId publishedBy, final Calendar publishedOn) throws SmackException;
public void publish(final ContainerVersion container, final Map<DocumentVersion, InputStream> documents, final List<JabberId> publishTo, final JabberId publishedBy, final Calendar publishedOn);
1,114,740
public User readCurrentUser() throws SmackException;
public User readCurrentUser();
1,114,741
public Profile readProfile() throws SmackException;
public Profile readProfile();
1,114,742
public void send(final ContainerVersion container, final Map<DocumentVersion, InputStream> documents, final List<JabberId> sendTo, final JabberId sentBy, final Calendar sentOn) throws SmackException;
public void send(final ContainerVersion container, final Map<DocumentVersion, InputStream> documents, final List<JabberId> sendTo, final JabberId sentBy, final Calendar sentOn);
1,114,743
private AbstractAction doCreateAction(final ActionId actionId) { logApiId(); debugVariable("actionId", actionId); final AbstractAction action; switch(actionId) { case ARTIFACT_APPLY_FLAG_SEEN: action = new com.thinkparity.browser.platform.action.artifact.ApplyFlagSeen(browser); break; case CONTACT_ACCEPT_INCOMING_INVITATION: action = new com.thinkparity.browser.platform.action.contact.AcceptIncomingInvitation(browser); break; case CONTACT_CREATE_INCOMING_INVITATION: action = new com.thinkparity.browser.platform.action.contact.CreateIncomingInvitation(browser); break; case CONTACT_DECLINE_INCOMING_INVITATION: action = new com.thinkparity.browser.platform.action.contact.DeclineIncomingInvitation(browser); break; case CONTACT_DELETE: action = new com.thinkparity.browser.platform.action.contact.Delete(browser); break; case CONTACT_DELETE_OUTGOING_INVITATION: action = new com.thinkparity.browser.platform.action.contact.DeleteOutgoingInvitation(browser); break; case CONTACT_READ: action = new com.thinkparity.browser.platform.action.contact.Read(browser); break; case CONTACT_SEARCH: action = new com.thinkparity.browser.platform.action.contact.Search(browser); break; case CONTAINER_ADD_DOCUMENT: action = new com.thinkparity.browser.platform.action.container.AddDocument(browser); break; case CONTAINER_CREATE: action = new com.thinkparity.browser.platform.action.container.Create(browser); break; case CONTAINER_DELETE: action = new com.thinkparity.browser.platform.action.container.Delete(browser); break; case CONTAINER_CREATE_DRAFT: action = new com.thinkparity.browser.platform.action.container.CreateDraft(browser); break; case CONTAINER_PUBLISH: action = new com.thinkparity.browser.platform.action.container.Publish(browser); break; case CONTAINER_REMOVE_DOCUMENT: action = new com.thinkparity.browser.platform.action.container.RemoveDocument(browser); break; case CONTAINER_SEARCH: action = new com.thinkparity.browser.platform.action.container.Search(browser); break; case DOCUMENT_OPEN: action = new com.thinkparity.browser.platform.action.document.Open(browser); break; case DOCUMENT_OPEN_VERSION: action = new com.thinkparity.browser.platform.action.document.OpenVersion(browser); break; case DOCUMENT_RENAME: action = new com.thinkparity.browser.platform.action.document.Rename(browser); break; case CONTAINER_REVERT_DOCUMENT: action = new com.thinkparity.browser.platform.action.container.RevertDocument(browser); break; case DOCUMENT_UPDATE_DRAFT: action = new com.thinkparity.browser.platform.action.document.UpdateDraft(browser); break; case PLATFORM_QUIT: action = new com.thinkparity.browser.platform.action.platform.Quit(platform); break; case PLATFORM_RESTART: action = new com.thinkparity.browser.platform.action.platform.Restart(platform); break; case PLATFORM_BROWSER_MOVE_TO_FRONT: action = new com.thinkparity.browser.platform.action.platform.browser.MoveToFront(platform); break; case PLATFORM_BROWSER_RESTORE: action = new com.thinkparity.browser.platform.action.platform.browser.Restore(platform); break; default: throw Assert.createUnreachable("UNKNOWN ACTION ID"); } register(action); return action; }
private AbstractAction doCreateAction(final ActionId actionId) { logApiId(); debugVariable("actionId", actionId); final AbstractAction action; switch(actionId) { case ARTIFACT_APPLY_FLAG_SEEN: action = new com.thinkparity.browser.platform.action.artifact.ApplyFlagSeen(browser); break; case CONTACT_ACCEPT_INCOMING_INVITATION: action = new com.thinkparity.browser.platform.action.contact.AcceptIncomingInvitation(browser); break; case CONTACT_CREATE_INCOMING_INVITATION: action = new com.thinkparity.browser.platform.action.contact.CreateIncomingInvitation(browser); break; case CONTACT_DECLINE_INCOMING_INVITATION: action = new com.thinkparity.browser.platform.action.contact.DeclineIncomingInvitation(browser); break; case CONTACT_DELETE: action = new com.thinkparity.browser.platform.action.contact.Delete(browser); break; case CONTACT_DELETE_OUTGOING_INVITATION: action = new com.thinkparity.browser.platform.action.contact.DeleteOutgoingInvitation(browser); break; case CONTACT_READ: action = new com.thinkparity.browser.platform.action.contact.Read(browser); break; case CONTACT_SEARCH: action = new com.thinkparity.browser.platform.action.contact.Search(browser); break; case CONTAINER_ADD_DOCUMENT: action = new com.thinkparity.browser.platform.action.container.AddDocument(browser); break; case CONTAINER_CREATE: action = new com.thinkparity.browser.platform.action.container.Create(browser); break; case CONTAINER_DELETE: action = new com.thinkparity.browser.platform.action.container.Delete(browser); break; case CONTAINER_CREATE_DRAFT: action = new com.thinkparity.browser.platform.action.container.CreateDraft(browser); break; case CONTAINER_PUBLISH: action = new com.thinkparity.browser.platform.action.container.Publish(browser); break; case CONTAINER_REMOVE_DOCUMENT: action = new com.thinkparity.browser.platform.action.container.RemoveDocument(browser); break; case CONTAINER_SEARCH: action = new com.thinkparity.browser.platform.action.container.Search(browser); break; case DOCUMENT_OPEN: action = new com.thinkparity.browser.platform.action.document.Open(browser); break; case DOCUMENT_OPEN_VERSION: action = new com.thinkparity.browser.platform.action.document.OpenVersion(browser); break; case DOCUMENT_RENAME: action = new com.thinkparity.browser.platform.action.document.Rename(browser); break; case CONTAINER_REVERT_DOCUMENT: action = new com.thinkparity.browser.platform.action.container.RevertDocument(browser); break; case DOCUMENT_UPDATE_DRAFT: action = new com.thinkparity.browser.platform.action.document.UpdateDraft(browser); break; case PLATFORM_QUIT: action = new com.thinkparity.browser.platform.action.platform.Quit(platform); break; case PLATFORM_RESTART: action = new com.thinkparity.browser.platform.action.platform.Restart(platform); break; case PLATFORM_BROWSER_MOVE_TO_FRONT: action = new com.thinkparity.browser.platform.action.platform.browser.MoveToFront(platform); break; case PLATFORM_BROWSER_RESTORE: action = new com.thinkparity.browser.platform.action.platform.browser.Restore(platform); break; default: throw Assert.createUnreachable("UNKNOWN ACTION ID"); } register(action); return action; }
1,114,744
public String exportFileName(final DocumentVersion version) { return MessageFormat.format("{0}.{1}", FileUtil.getName(version.getName()), FileUtil.getExtension(version.getName())); }
public String exportFileName(final DocumentVersion version) { return MessageFormat.format("{0}{1}", FileUtil.getName(version.getName()), FileUtil.getExtension(version.getName())); }
1,114,746
public CustomTableModel(final Long containerId) { super(); if (null==containerId) { // Likely true on first call to reload() teamMembers = null; contacts = null; publishTo = null; } else { teamMembers = readTeamMembers(containerId); contacts = readContacts(); publishTo = new ArrayList<Boolean>(getRowCount()); for (int i = 0; i < getRowCount(); i++) { if (i < teamMembers.size()) { publishTo.add(Boolean.TRUE); } else { publishTo.add(Boolean.FALSE); } } } }
public CustomTableModel(final Long containerId) { super(); if (null==containerId) { // Likely true on first call to reload() teamMembers = null; contacts = null; publishTo = null; } else { teamMembers = readTeamMembers(containerId); contacts = readContacts(teamMembers); publishTo = new ArrayList<Boolean>(getRowCount()); for (int i = 0; i < getRowCount(); i++) { if (i < teamMembers.size()) { publishTo.add(Boolean.TRUE); } else { publishTo.add(Boolean.FALSE); } } } }
1,114,747
private List<Contact> readContacts() { final List<Contact> list = new LinkedList<Contact>(); final Contact[] array = (Contact[]) ((CompositeFlatSingleContentProvider) contentProvider).getElements(0, null); for (final Contact contact : array) { list.add(contact); } return list; }
private List<Contact> readContacts(List<TeamMember> teamMembers) { final List<Contact> list = new LinkedList<Contact>(); final Contact[] array = (Contact[]) ((CompositeFlatSingleContentProvider) contentProvider).getElements(0, null); for (final Contact contact : array) { list.add(contact); } return list; }
1,114,748
private List<Contact> readContacts() { final List<Contact> list = new LinkedList<Contact>(); final Contact[] array = (Contact[]) ((CompositeFlatSingleContentProvider) contentProvider).getElements(0, null); for (final Contact contact : array) { list.add(contact); } return list; }
private List<Contact> readContacts() { final List<Contact> list = new LinkedList<Contact>(); final Contact[] array = (Contact[]) ((CompositeFlatSingleContentProvider) contentProvider).getElements(0, null); for (final Contact contact : array) { Boolean found = Boolean.FALSE; for (final TeamMember teamMember : teamMembers) { if (teamMember.getId().equals(contact.getId())) { found = Boolean.TRUE; break; } } if (!found) { list.add((Contact) contact); } } return list; }
1,114,749
private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; javax.swing.JLabel separator1JLabel; javax.swing.JLabel separator2JLabel; connectionJLabel = LabelFactory.create(getString("Empty"), BrowserConstants.Fonts.SmallFont); separator1JLabel = new javax.swing.JLabel(); filterJLabel = LabelFactory.create(getString("Empty"), BrowserConstants.Fonts.SmallFont); separator2JLabel = new javax.swing.JLabel(); customJLabel = LabelFactory.create(getString("Empty"), BrowserConstants.Fonts.SmallFont); setLayout(new java.awt.GridBagLayout()); setOpaque(false); addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent e) { formMouseClicked(e); } }); connectionJLabel.setText("!Offline!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.insets = new java.awt.Insets(3, 4, 0, 4); add(connectionJLabel, gridBagConstraints); separator1JLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/StatusVSeparator.png")));gridBagConstraints = new java.awt.GridBagConstraints();gridBagConstraints.insets = new java.awt.Insets(3, 0, 0, 0); add(separator1JLabel,gridBagConstraints); filterJLabel.setText("!Filter: Off!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.insets = new java.awt.Insets(3, 4, 0, 4); add(filterJLabel, gridBagConstraints); separator2JLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/StatusVSeparator.png")));gridBagConstraints = new java.awt.GridBagConstraints();gridBagConstraints.insets = new java.awt.Insets(3, 0, 0, 0); add(separator2JLabel,gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(3, 4, 0, 4); add(customJLabel, gridBagConstraints); }// </editor-fold>//GEN-END:initComponents
private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; javax.swing.JLabel separator1JLabel; javax.swing.JLabel separator2JLabel; connectionJLabel = LabelFactory.create(getString("Empty"), BrowserConstants.Fonts.StatusBar); separator1JLabel = new javax.swing.JLabel(); filterJLabel = LabelFactory.create(getString("Empty"), BrowserConstants.Fonts.SmallFont); separator2JLabel = new javax.swing.JLabel(); customJLabel = LabelFactory.create(getString("Empty"), BrowserConstants.Fonts.SmallFont); setLayout(new java.awt.GridBagLayout()); setOpaque(false); addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent e) { formMouseClicked(e); } }); connectionJLabel.setText("!Offline!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.insets = new java.awt.Insets(3, 4, 0, 4); add(connectionJLabel, gridBagConstraints); separator1JLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/StatusVSeparator.png")));gridBagConstraints = new java.awt.GridBagConstraints();gridBagConstraints.insets = new java.awt.Insets(3, 0, 0, 0); add(separator1JLabel,gridBagConstraints); filterJLabel.setText("!Filter: Off!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.insets = new java.awt.Insets(3, 4, 0, 4); add(filterJLabel, gridBagConstraints); separator2JLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/StatusVSeparator.png")));gridBagConstraints = new java.awt.GridBagConstraints();gridBagConstraints.insets = new java.awt.Insets(3, 0, 0, 0); add(separator2JLabel,gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(3, 4, 0, 4); add(customJLabel, gridBagConstraints); }// </editor-fold>//GEN-END:initComponents
1,114,750
private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; javax.swing.JLabel separator1JLabel; javax.swing.JLabel separator2JLabel; connectionJLabel = LabelFactory.create(getString("Empty"), BrowserConstants.Fonts.SmallFont); separator1JLabel = new javax.swing.JLabel(); filterJLabel = LabelFactory.create(getString("Empty"), BrowserConstants.Fonts.SmallFont); separator2JLabel = new javax.swing.JLabel(); customJLabel = LabelFactory.create(getString("Empty"), BrowserConstants.Fonts.SmallFont); setLayout(new java.awt.GridBagLayout()); setOpaque(false); addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent e) { formMouseClicked(e); } }); connectionJLabel.setText("!Offline!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.insets = new java.awt.Insets(3, 4, 0, 4); add(connectionJLabel, gridBagConstraints); separator1JLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/StatusVSeparator.png")));gridBagConstraints = new java.awt.GridBagConstraints();gridBagConstraints.insets = new java.awt.Insets(3, 0, 0, 0); add(separator1JLabel,gridBagConstraints); filterJLabel.setText("!Filter: Off!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.insets = new java.awt.Insets(3, 4, 0, 4); add(filterJLabel, gridBagConstraints); separator2JLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/StatusVSeparator.png")));gridBagConstraints = new java.awt.GridBagConstraints();gridBagConstraints.insets = new java.awt.Insets(3, 0, 0, 0); add(separator2JLabel,gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(3, 4, 0, 4); add(customJLabel, gridBagConstraints); }// </editor-fold>//GEN-END:initComponents
private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; javax.swing.JLabel separator1JLabel; javax.swing.JLabel separator2JLabel; connectionJLabel = LabelFactory.create(getString("Empty"), BrowserConstants.Fonts.SmallFont); separator1JLabel = new javax.swing.JLabel(); filterJLabel = LabelFactory.create(getString("Empty"), BrowserConstants.Fonts.StatusBar); separator2JLabel = new javax.swing.JLabel(); customJLabel = LabelFactory.create(getString("Empty"), BrowserConstants.Fonts.SmallFont); setLayout(new java.awt.GridBagLayout()); setOpaque(false); addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent e) { formMouseClicked(e); } }); connectionJLabel.setText("!Offline!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.insets = new java.awt.Insets(3, 4, 0, 4); add(connectionJLabel, gridBagConstraints); separator1JLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/StatusVSeparator.png")));gridBagConstraints = new java.awt.GridBagConstraints();gridBagConstraints.insets = new java.awt.Insets(3, 0, 0, 0); add(separator1JLabel,gridBagConstraints); filterJLabel.setText("!Filter: Off!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.insets = new java.awt.Insets(3, 4, 0, 4); add(filterJLabel, gridBagConstraints); separator2JLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/StatusVSeparator.png")));gridBagConstraints = new java.awt.GridBagConstraints();gridBagConstraints.insets = new java.awt.Insets(3, 0, 0, 0); add(separator2JLabel,gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(3, 4, 0, 4); add(customJLabel, gridBagConstraints); }// </editor-fold>//GEN-END:initComponents
1,114,751
protected Template handleRequest(HttpServletRequest request, HttpServletResponse response, Context ctx ) throws Exception { return getTemplate(request.getServletPath() ); }
protected Template handleRequest(HttpServletRequest request, HttpServletResponse response, Context ctx ) throws Exception { String path = (String)request.getAttribute("javax.servlet.include.servlet_path"); if (path == null) { path = request.getServletPath(); } return getTemplate(path); }
1,114,752
protected void setUp() throws Exception { super.setUp(); login(OpheliaTestUser.JUNIT); login(OpheliaTestUser.JUNIT_X); final InternalContainerModel containerModel = getContainerModel(OpheliaTestUser.JUNIT); final Container container = createContainer(OpheliaTestUser.JUNIT, NAME); final List<Document> documents = addDocuments(OpheliaTestUser.JUNIT, container); publishToContacts(OpheliaTestUser.JUNIT, container); createDraft(OpheliaTestUser.JUNIT, container); // remove half of the documents for (int i = 0; i < documents.size(); i++) { if (1 == i % 2) containerModel.removeDocument(container.getId(), documents.get(i).getId()); } publishToTeam(OpheliaTestUser.JUNIT, container); // re-add half of the documents createDraft(OpheliaTestUser.JUNIT_X, container); final File[] inputFiles = getInputFiles(); for (int i = 0; i < inputFiles.length; i++) { if (1 == i % 2) { addDocument(OpheliaTestUser.JUNIT, container, inputFiles[i]); } } publishToTeam(OpheliaTestUser.JUNIT_X, container); datum = new Fixture(container, containerModel, getOutputDirectory()); }
protected void setUp() throws Exception { super.setUp(); login(OpheliaTestUser.JUNIT); login(OpheliaTestUser.JUNIT_X); final InternalContainerModel containerModel = getContainerModel(OpheliaTestUser.JUNIT); final Container container = createContainer(OpheliaTestUser.JUNIT, NAME); final List<Document> documents = addDocuments(OpheliaTestUser.JUNIT, container); publishToContacts(OpheliaTestUser.JUNIT, container); createDraft(OpheliaTestUser.JUNIT, container.getId()); // remove half of the documents for (int i = 0; i < documents.size(); i++) { if (1 == i % 2) containerModel.removeDocument(container.getId(), documents.get(i).getId()); } publishToTeam(OpheliaTestUser.JUNIT, container); // re-add half of the documents createDraft(OpheliaTestUser.JUNIT_X, container); final File[] inputFiles = getInputFiles(); for (int i = 0; i < inputFiles.length; i++) { if (1 == i % 2) { addDocument(OpheliaTestUser.JUNIT, container, inputFiles[i]); } } publishToTeam(OpheliaTestUser.JUNIT_X, container); datum = new Fixture(container, containerModel, getOutputDirectory()); }
1,114,756
protected void setUp() throws Exception { super.setUp(); login(OpheliaTestUser.JUNIT); login(OpheliaTestUser.JUNIT_X); final InternalContainerModel containerModel = getContainerModel(OpheliaTestUser.JUNIT); final Container container = createContainer(OpheliaTestUser.JUNIT, NAME); final List<Document> documents = addDocuments(OpheliaTestUser.JUNIT, container); publishToContacts(OpheliaTestUser.JUNIT, container); createDraft(OpheliaTestUser.JUNIT, container); // remove half of the documents for (int i = 0; i < documents.size(); i++) { if (1 == i % 2) containerModel.removeDocument(container.getId(), documents.get(i).getId()); } publishToTeam(OpheliaTestUser.JUNIT, container); // re-add half of the documents createDraft(OpheliaTestUser.JUNIT_X, container); final File[] inputFiles = getInputFiles(); for (int i = 0; i < inputFiles.length; i++) { if (1 == i % 2) { addDocument(OpheliaTestUser.JUNIT, container, inputFiles[i]); } } publishToTeam(OpheliaTestUser.JUNIT_X, container); datum = new Fixture(container, containerModel, getOutputDirectory()); }
protected void setUp() throws Exception { super.setUp(); login(OpheliaTestUser.JUNIT); login(OpheliaTestUser.JUNIT_X); final InternalContainerModel containerModel = getContainerModel(OpheliaTestUser.JUNIT); final Container container = createContainer(OpheliaTestUser.JUNIT, NAME); final List<Document> documents = addDocuments(OpheliaTestUser.JUNIT, container); publishToContacts(OpheliaTestUser.JUNIT, container); createDraft(OpheliaTestUser.JUNIT, container); // remove half of the documents for (int i = 0; i < documents.size(); i++) { if (1 == i % 2) containerModel.removeDocument(container.getId(), documents.get(i).getId()); } publishToTeam(OpheliaTestUser.JUNIT, container.getId()); // re-add half of the documents createDraft(OpheliaTestUser.JUNIT_X, container); final File[] inputFiles = getInputFiles(); for (int i = 0; i < inputFiles.length; i++) { if (1 == i % 2) { addDocument(OpheliaTestUser.JUNIT, container, inputFiles[i]); } } publishToTeam(OpheliaTestUser.JUNIT_X, container); datum = new Fixture(container, containerModel, getOutputDirectory()); }
1,114,757
protected void setUp() throws Exception { super.setUp(); login(OpheliaTestUser.JUNIT); login(OpheliaTestUser.JUNIT_X); final InternalContainerModel containerModel = getContainerModel(OpheliaTestUser.JUNIT); final Container container = createContainer(OpheliaTestUser.JUNIT, NAME); final List<Document> documents = addDocuments(OpheliaTestUser.JUNIT, container); publishToContacts(OpheliaTestUser.JUNIT, container); createDraft(OpheliaTestUser.JUNIT, container); // remove half of the documents for (int i = 0; i < documents.size(); i++) { if (1 == i % 2) containerModel.removeDocument(container.getId(), documents.get(i).getId()); } publishToTeam(OpheliaTestUser.JUNIT, container); // re-add half of the documents createDraft(OpheliaTestUser.JUNIT_X, container); final File[] inputFiles = getInputFiles(); for (int i = 0; i < inputFiles.length; i++) { if (1 == i % 2) { addDocument(OpheliaTestUser.JUNIT, container, inputFiles[i]); } } publishToTeam(OpheliaTestUser.JUNIT_X, container); datum = new Fixture(container, containerModel, getOutputDirectory()); }
protected void setUp() throws Exception { super.setUp(); login(OpheliaTestUser.JUNIT); login(OpheliaTestUser.JUNIT_X); final InternalContainerModel containerModel = getContainerModel(OpheliaTestUser.JUNIT); final Container container = createContainer(OpheliaTestUser.JUNIT, NAME); final List<Document> documents = addDocuments(OpheliaTestUser.JUNIT, container); publishToContacts(OpheliaTestUser.JUNIT, container); createDraft(OpheliaTestUser.JUNIT, container); // remove half of the documents for (int i = 0; i < documents.size(); i++) { if (1 == i % 2) containerModel.removeDocument(container.getId(), documents.get(i).getId()); } publishToTeam(OpheliaTestUser.JUNIT, container); // re-add half of the documents createDraft(OpheliaTestUser.JUNIT_X, container.getId()); final File[] inputFiles = getInputFiles(); for (int i = 0; i < inputFiles.length; i++) { if (1 == i % 2) { addDocument(OpheliaTestUser.JUNIT, container, inputFiles[i]); } } publishToTeam(OpheliaTestUser.JUNIT_X, container); datum = new Fixture(container, containerModel, getOutputDirectory()); }
1,114,758
protected void setUp() throws Exception { super.setUp(); login(OpheliaTestUser.JUNIT); login(OpheliaTestUser.JUNIT_X); final InternalContainerModel containerModel = getContainerModel(OpheliaTestUser.JUNIT); final Container container = createContainer(OpheliaTestUser.JUNIT, NAME); final List<Document> documents = addDocuments(OpheliaTestUser.JUNIT, container); publishToContacts(OpheliaTestUser.JUNIT, container); createDraft(OpheliaTestUser.JUNIT, container); // remove half of the documents for (int i = 0; i < documents.size(); i++) { if (1 == i % 2) containerModel.removeDocument(container.getId(), documents.get(i).getId()); } publishToTeam(OpheliaTestUser.JUNIT, container); // re-add half of the documents createDraft(OpheliaTestUser.JUNIT_X, container); final File[] inputFiles = getInputFiles(); for (int i = 0; i < inputFiles.length; i++) { if (1 == i % 2) { addDocument(OpheliaTestUser.JUNIT, container, inputFiles[i]); } } publishToTeam(OpheliaTestUser.JUNIT_X, container); datum = new Fixture(container, containerModel, getOutputDirectory()); }
protected void setUp() throws Exception { super.setUp(); login(OpheliaTestUser.JUNIT); login(OpheliaTestUser.JUNIT_X); final InternalContainerModel containerModel = getContainerModel(OpheliaTestUser.JUNIT); final Container container = createContainer(OpheliaTestUser.JUNIT, NAME); final List<Document> documents = addDocuments(OpheliaTestUser.JUNIT, container); publishToContacts(OpheliaTestUser.JUNIT, container); createDraft(OpheliaTestUser.JUNIT, container); // remove half of the documents for (int i = 0; i < documents.size(); i++) { if (1 == i % 2) containerModel.removeDocument(container.getId(), documents.get(i).getId()); } publishToTeam(OpheliaTestUser.JUNIT, container); // re-add half of the documents createDraft(OpheliaTestUser.JUNIT_X, container); final File[] inputFiles = getInputFiles(); for (int i = 0; i < inputFiles.length; i++) { if (1 == i % 2) { addDocument(OpheliaTestUser.JUNIT, container, inputFiles[i]); } } publishToTeam(OpheliaTestUser.JUNIT_X, container.getId()); datum = new Fixture(container, containerModel, getOutputDirectory()); }
1,114,759
private AbstractEastCell() { super(); setEnabled(isLatest()); }
private AbstractEastCell(final WestCell parent) { super(); setEnabled(isLatest()); }
1,114,760
private AbstractWestCell() { super(); setEnabled(isLatest()); add(EmptyCell.getEmptyCell()); }
private AbstractWestCell() { super(); setEnabled(isLatest()); add(new EmptyEastCell(this)); }
1,114,762
private void addUserCells(final List<TeamMember> team) { for (final TeamMember teamMember : team) { add(new ContainerVersionUserCell(this, teamMember)); } }
private void addUserCells(final List<TeamMember> team) { for (final TeamMember teamMember : team) { add(new ContainerTeamMemberCell(this, teamMember)); } }
1,114,763
private ContainerDraftDocumentCell(final WestCell parent, final Document document, final DraftView draftView) { super(); this.parent = parent; this.document = document; setIcon(fileIconReader.getIcon(document)); switch (draftView.getDraft().getState(document)) { case ADDED: setAdditionalText(localization.getString("DocumentSummaryDraftAdded")); break; case MODIFIED: setAdditionalText(localization.getString("DocumentSummaryDraftModified", formatFuzzy(draftView.getFirstPublishedOn(document)))); break; case REMOVED: setAdditionalText(localization.getString("DocumentSummaryDraftRemoved", formatFuzzy(draftView.getFirstPublishedOn(document)))); break; case NONE: setAdditionalText(localization.getString("DocumentSummary", formatFuzzy(draftView.getFirstPublishedOn(document)))); break; default: throw Assert.createUnreachable("UNKNOWN DOCUMENT STATE"); } setText(document.getName()); }
private ContainerDraftDocumentCell(final WestCell parent, final Document document, final DraftView draftView) { super(); this.parent = parent; this.document = document; setIcon(fileIconReader.getIcon(document)); switch (draftView.getDraft().getState(document)) { case ADDED: setAdditionalText(localization.getString("DocumentSummaryDraftAdded")); break; case MODIFIED: setAdditionalText(localization.getString("DocumentSummaryDraftModified", formatFuzzy(draftView.getFirstPublishedOn(document)))); break; case REMOVED: setAdditionalText(localization.getString("DocumentSummaryDraftRemoved", formatFuzzy(draftView.getFirstPublishedOn(document)))); break; case NONE: setAdditionalText(localization.getString("DocumentSummary", formatFuzzy(draftView.getFirstPublishedOn(document)))); break; default: throw Assert.createUnreachable("UNKNOWN DOCUMENT STATE"); } setText(document.getName()); }
1,114,764
private ContainerVersionDocumentCell(final WestCell parent, final ContainerVersion containerVersion, final DocumentView documentView) { super(); this.parent = parent; this.delta = documentView.getDelta(); this.version = documentView.getVersion(); setIcon(fileIconReader.getIcon(version)); switch (delta) { case ADDED: case MODIFIED: case NONE: setAdditionalText(localization.getString("DocumentSummary", formatFuzzy(documentView.getFirstPublishedOn()))); break; case REMOVED: setAdditionalText(localization.getString("DocumentSummaryVersionRemoved", formatFuzzy(documentView.getFirstPublishedOn()), formatFuzzy(containerVersion.getCreatedOn()))); break; default: throw Assert.createUnreachable("UNKNOWN DOCUMENT STATE"); } setText(version.getName()); }
private ContainerVersionDocumentCell(final WestCell parent, final ContainerVersion containerVersion, final DocumentView documentView) { super(); this.parent = parent; this.delta = documentView.getDelta(); this.version = documentView.getVersion(); setIcon(fileIconReader.getIcon(version)); switch (delta) { case ADDED: case MODIFIED: case NONE: setAdditionalText(localization.getString("DocumentSummary", formatFuzzy(documentView.getFirstPublishedOn()))); break; case REMOVED: setAdditionalText(localization.getString("DocumentSummaryVersionRemoved", formatFuzzy(documentView.getFirstPublishedOn()), formatFuzzy(containerVersion.getCreatedOn()))); break; default: throw Assert.createUnreachable("UNKNOWN DOCUMENT STATE"); } setText(version.getName()); }
1,114,765
private DraftCell() { super(); for (final Document document : draft.getDocuments()) { add(new DraftDocumentCell(document)); } }
private DraftCell() { super(); for (final Document document : draft.getDocuments()) { add(new DraftDocumentCell(this, document)); } }
1,114,766
private DraftDocumentCell(final Document document) { super(); this.document = document; setIcon(fileIconReader.getIcon(document)); switch (draft.getState(document)) { case ADDED: case MODIFIED: case REMOVED: setAdditionalText(localization.getString(draft.getState(document))); break; case NONE: break; default: throw Assert.createUnreachable("UNKNOWN DOCUMENT STATE"); } setText(document.getName()); }
private DraftDocumentCell(final Document document) { super(); this.document = document; setIcon(fileIconReader.getIcon(document)); switch (draft.getState(document)) { case ADDED: case MODIFIED: case REMOVED: setAdditionalText(localization.getString(draft.getState(document))); break; case NONE: break; default: throw Assert.createUnreachable("UNKNOWN DOCUMENT STATE"); } setText(document.getName()); }
1,114,767
private VersionDocumentCell(final WestCell parent, final DocumentVersion version, final Delta delta) { super(); this.delta = delta; this.parent = parent; this.version = version; setIcon(fileIconReader.getIcon(version)); switch (delta) { case ADDED: case MODIFIED: case REMOVED: setAdditionalText(localization.getString(delta)); break; case NONE: break; default: throw Assert.createUnreachable("UNKNOWN DOCUMENT STATE"); } setText(version.getName()); }
private VersionDocumentCell(final WestCell parent, final DocumentVersion version, final Delta delta) { super(parent); this.delta = delta; this.parent = parent; this.version = version; setIcon(fileIconReader.getIcon(version)); switch (delta) { case ADDED: case MODIFIED: case REMOVED: setAdditionalText(localization.getString(delta)); break; case NONE: break; default: throw Assert.createUnreachable("UNKNOWN DOCUMENT STATE"); } setText(version.getName()); }
1,114,768
private VersionDocumentCell(final WestCell parent, final DocumentVersion version, final Delta delta) { super(); this.delta = delta; this.parent = parent; this.version = version; setIcon(fileIconReader.getIcon(version)); switch (delta) { case ADDED: case MODIFIED: case REMOVED: setAdditionalText(localization.getString(delta)); break; case NONE: break; default: throw Assert.createUnreachable("UNKNOWN DOCUMENT STATE"); } setText(version.getName()); }
private VersionDocumentCell(final WestCell parent, final DocumentVersion version, final Delta delta) { super(); this.delta = delta; this.version = version; setIcon(fileIconReader.getIcon(version)); switch (delta) { case ADDED: case MODIFIED: case REMOVED: setAdditionalText(localization.getString(delta)); break; case NONE: break; default: throw Assert.createUnreachable("UNKNOWN DOCUMENT STATE"); } setText(version.getName()); }
1,114,769
private VersionUserCell(final WestCell parent, final User user) { super(); this.parent = parent; this.user = user; setIcon(IMAGE_CACHE.read(TabPanelIcon.USER)); setText(user.getName()); setAdditionalText(localization.getString("UserPublished")); }
private VersionUserCell(final WestCell parent, final User user) { super(); this.parent = parent; this.user = user; setIcon(IMAGE_CACHE.read(TabPanelIcon.USER)); setText(user.getName()); setAdditionalText(localization.getString("UserPublished")); }
1,114,770
private void initComponents() { javax.swing.JLabel eastFillerJLabel; java.awt.GridBagConstraints gridBagConstraints; javax.swing.JLabel westFillerJLabel; westListJPanel = new PanelCellListJPanel(westListModel, ListType.WEST_LIST); westFillerJLabel = new javax.swing.JLabel(); eastListJPanel = new PanelCellListJPanel(eastListModel, ListType.EAST_LIST); eastFillerJLabel = new javax.swing.JLabel(); setLayout(new java.awt.GridBagLayout()); setBorder(BORDER); collapsedJPanel.setLayout(new java.awt.GridBagLayout()); collapsedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { collapsedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { collapsedJPanelMouseReleased(e); } }); iconJLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/IconContainer.png"))); iconJLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent e) { iconJLabelMouseEntered(e); } public void mouseExited(java.awt.event.MouseEvent e) { iconJLabelMouseExited(e); } public void mousePressed(java.awt.event.MouseEvent e) { iconJLabelMousePressed(e); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; gridBagConstraints.insets = new java.awt.Insets(4, 32, 0, 5); collapsedJPanel.add(iconJLabel, gridBagConstraints); textJLabel.setText("!Package Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.insets = new java.awt.Insets(5, 3, 4, 0); collapsedJPanel.add(textJLabel, gridBagConstraints); additionalTextJLabel.setForeground(Colors.Browser.List.INNER_LIST_SELECTION_BORDER); additionalTextJLabel.setText("!Package Additional Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 4, 0); collapsedJPanel.add(additionalTextJLabel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(collapsedJPanel, gridBagConstraints); expandedJPanel.setLayout(new java.awt.GridLayout(1, 0)); expandedJPanel.setOpaque(false); expandedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { expandedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { expandedJPanelMouseReleased(e); } }); westJPanel.setLayout(new java.awt.GridBagLayout()); westJPanel.setOpaque(false); westListJPanel.setLayout(new java.awt.GridBagLayout()); westListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; westJPanel.add(westListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); westJPanel.add(westFillerJLabel, gridBagConstraints); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("localization/ListItem_Messages"); // NOI18N westFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 5); westJPanel.add(westFirstJLabel, gridBagConstraints); westPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westPreviousJLabel, gridBagConstraints); westCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westCountJLabel, gridBagConstraints); westNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westNextJLabel, gridBagConstraints); westLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westLastJLabel, gridBagConstraints); expandedJPanel.add(westJPanel); eastJPanel.setLayout(new java.awt.GridBagLayout()); eastJPanel.setOpaque(false); eastListJPanel.setLayout(new java.awt.GridBagLayout()); eastListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; eastJPanel.add(eastListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); eastJPanel.add(eastFillerJLabel, gridBagConstraints); eastFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastFirstJLabel, gridBagConstraints); eastPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastPreviousJLabel, gridBagConstraints); eastCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastCountJLabel, gridBagConstraints); eastNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastNextJLabel, gridBagConstraints); eastLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastLastJLabel, gridBagConstraints); expandedJPanel.add(eastJPanel); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(expandedJPanel, gridBagConstraints); }// </editor-fold>//GEN-END:initComponents
private void initComponents() { javax.swing.JLabel eastFillerJLabel; java.awt.GridBagConstraints gridBagConstraints; javax.swing.JLabel westFillerJLabel; westListJPanel = new PanelCellListJPanel(westListModel, ListType.WEST_LIST); westFillerJLabel = new javax.swing.JLabel(); eastListJPanel = new PanelCellListJPanel(eastListModel, ListType.EAST_LIST); eastFillerJLabel = new javax.swing.JLabel(); setLayout(new java.awt.GridBagLayout()); setBorder(BORDER); collapsedJPanel.setLayout(new java.awt.GridBagLayout()); collapsedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { collapsedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { collapsedJPanelMouseReleased(e); } }); iconJLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/IconContainer.png"))); iconJLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent e) { iconJLabelMouseEntered(e); } public void mouseExited(java.awt.event.MouseEvent e) { iconJLabelMouseExited(e); } public void mousePressed(java.awt.event.MouseEvent e) { iconJLabelMousePressed(e); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; gridBagConstraints.insets = new java.awt.Insets(4, 32, 0, 5); collapsedJPanel.add(iconJLabel, gridBagConstraints); textJLabel.setText("!Package Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.insets = new java.awt.Insets(5, 3, 4, 0); collapsedJPanel.add(textJLabel, gridBagConstraints); additionalTextJLabel.setForeground(Colors.Browser.List.INNER_LIST_SELECTION_BORDER); additionalTextJLabel.setText("!Package Additional Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 4, 0); collapsedJPanel.add(additionalTextJLabel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(collapsedJPanel, gridBagConstraints); expandedJPanel.setLayout(new java.awt.GridLayout(1, 0)); expandedJPanel.setOpaque(false); expandedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { expandedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { expandedJPanelMouseReleased(e); } }); westJPanel.setLayout(new java.awt.GridBagLayout()); westJPanel.setOpaque(false); westListJPanel.setLayout(new java.awt.GridBagLayout()); westListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; westJPanel.add(westListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); westJPanel.add(westFillerJLabel, gridBagConstraints); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("localization/ListItem_Messages"); // NOI18N westFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 5); westJPanel.add(westFirstJLabel, gridBagConstraints); westPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westPreviousJLabel, gridBagConstraints); westCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westCountJLabel, gridBagConstraints); westNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westNextJLabel, gridBagConstraints); westLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westLastJLabel, gridBagConstraints); expandedJPanel.add(westJPanel); eastJPanel.setLayout(new java.awt.GridBagLayout()); eastJPanel.setOpaque(false); eastListJPanel.setLayout(new java.awt.GridBagLayout()); eastListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; eastJPanel.add(eastListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); eastJPanel.add(eastFillerJLabel, gridBagConstraints); eastFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastFirstJLabel, gridBagConstraints); eastPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastPreviousJLabel, gridBagConstraints); eastCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastCountJLabel, gridBagConstraints); eastNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastNextJLabel, gridBagConstraints); eastLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastLastJLabel, gridBagConstraints); expandedJPanel.add(eastJPanel); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(expandedJPanel, gridBagConstraints); }// </editor-fold>//GEN-END:initComponents
1,114,771
private void initComponents() { javax.swing.JLabel eastFillerJLabel; java.awt.GridBagConstraints gridBagConstraints; javax.swing.JLabel westFillerJLabel; westListJPanel = new PanelCellListJPanel(westListModel, ListType.WEST_LIST); westFillerJLabel = new javax.swing.JLabel(); eastListJPanel = new PanelCellListJPanel(eastListModel, ListType.EAST_LIST); eastFillerJLabel = new javax.swing.JLabel(); setLayout(new java.awt.GridBagLayout()); setBorder(BORDER); collapsedJPanel.setLayout(new java.awt.GridBagLayout()); collapsedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { collapsedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { collapsedJPanelMouseReleased(e); } }); iconJLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/IconContainer.png"))); iconJLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent e) { iconJLabelMouseEntered(e); } public void mouseExited(java.awt.event.MouseEvent e) { iconJLabelMouseExited(e); } public void mousePressed(java.awt.event.MouseEvent e) { iconJLabelMousePressed(e); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; gridBagConstraints.insets = new java.awt.Insets(4, 32, 0, 5); collapsedJPanel.add(iconJLabel, gridBagConstraints); textJLabel.setText("!Package Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.insets = new java.awt.Insets(5, 3, 4, 0); collapsedJPanel.add(textJLabel, gridBagConstraints); additionalTextJLabel.setForeground(Colors.Browser.List.INNER_LIST_SELECTION_BORDER); additionalTextJLabel.setText("!Package Additional Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 4, 0); collapsedJPanel.add(additionalTextJLabel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(collapsedJPanel, gridBagConstraints); expandedJPanel.setLayout(new java.awt.GridLayout(1, 0)); expandedJPanel.setOpaque(false); expandedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { expandedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { expandedJPanelMouseReleased(e); } }); westJPanel.setLayout(new java.awt.GridBagLayout()); westJPanel.setOpaque(false); westListJPanel.setLayout(new java.awt.GridBagLayout()); westListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; westJPanel.add(westListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); westJPanel.add(westFillerJLabel, gridBagConstraints); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("localization/ListItem_Messages"); // NOI18N westFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 5); westJPanel.add(westFirstJLabel, gridBagConstraints); westPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westPreviousJLabel, gridBagConstraints); westCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westCountJLabel, gridBagConstraints); westNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westNextJLabel, gridBagConstraints); westLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westLastJLabel, gridBagConstraints); expandedJPanel.add(westJPanel); eastJPanel.setLayout(new java.awt.GridBagLayout()); eastJPanel.setOpaque(false); eastListJPanel.setLayout(new java.awt.GridBagLayout()); eastListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; eastJPanel.add(eastListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); eastJPanel.add(eastFillerJLabel, gridBagConstraints); eastFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastFirstJLabel, gridBagConstraints); eastPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastPreviousJLabel, gridBagConstraints); eastCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastCountJLabel, gridBagConstraints); eastNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastNextJLabel, gridBagConstraints); eastLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastLastJLabel, gridBagConstraints); expandedJPanel.add(eastJPanel); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(expandedJPanel, gridBagConstraints); }// </editor-fold>//GEN-END:initComponents
private void initComponents() { javax.swing.JLabel eastFillerJLabel; java.awt.GridBagConstraints gridBagConstraints; javax.swing.JLabel westFillerJLabel; westListJPanel = new PanelCellListJPanel(westListModel, ListType.WEST_LIST); westFillerJLabel = new javax.swing.JLabel(); eastListJPanel = new PanelCellListJPanel(eastListModel, ListType.EAST_LIST); eastFillerJLabel = new javax.swing.JLabel(); setLayout(new java.awt.GridBagLayout()); setBorder(BORDER); collapsedJPanel.setLayout(new java.awt.GridBagLayout()); collapsedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { collapsedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { collapsedJPanelMouseReleased(e); } }); iconJLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/IconContainer.png"))); iconJLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent e) { iconJLabelMouseEntered(e); } public void mouseExited(java.awt.event.MouseEvent e) { iconJLabelMouseExited(e); } public void mousePressed(java.awt.event.MouseEvent e) { iconJLabelMousePressed(e); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; gridBagConstraints.insets = new java.awt.Insets(4, 32, 0, 5); collapsedJPanel.add(iconJLabel, gridBagConstraints); textJLabel.setText("!Package Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.insets = new java.awt.Insets(5, 3, 4, 0); collapsedJPanel.add(textJLabel, gridBagConstraints); additionalTextJLabel.setForeground(Colors.Browser.List.INNER_LIST_SELECTION_BORDER); additionalTextJLabel.setText("!Package Additional Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 4, 0); collapsedJPanel.add(additionalTextJLabel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(collapsedJPanel, gridBagConstraints); expandedJPanel.setLayout(new java.awt.GridLayout(1, 0)); expandedJPanel.setOpaque(false); expandedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { expandedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { expandedJPanelMouseReleased(e); } }); westJPanel.setLayout(new java.awt.GridBagLayout()); westJPanel.setOpaque(false); westListJPanel.setLayout(new java.awt.GridBagLayout()); westListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; westJPanel.add(westListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); westJPanel.add(westFillerJLabel, gridBagConstraints); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("localization/ListItem_Messages"); // NOI18N westFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 5); westJPanel.add(westFirstJLabel, gridBagConstraints); westPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westPreviousJLabel, gridBagConstraints); westCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westCountJLabel, gridBagConstraints); westNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westNextJLabel, gridBagConstraints); westLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westLastJLabel, gridBagConstraints); expandedJPanel.add(westJPanel); eastJPanel.setLayout(new java.awt.GridBagLayout()); eastJPanel.setOpaque(false); eastListJPanel.setLayout(new java.awt.GridBagLayout()); eastListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; eastJPanel.add(eastListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); eastJPanel.add(eastFillerJLabel, gridBagConstraints); eastFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastFirstJLabel, gridBagConstraints); eastPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastPreviousJLabel, gridBagConstraints); eastCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastCountJLabel, gridBagConstraints); eastNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastNextJLabel, gridBagConstraints); eastLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastLastJLabel, gridBagConstraints); expandedJPanel.add(eastJPanel); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(expandedJPanel, gridBagConstraints); }// </editor-fold>//GEN-END:initComponents
1,114,772
private void initComponents() { javax.swing.JLabel eastFillerJLabel; java.awt.GridBagConstraints gridBagConstraints; javax.swing.JLabel westFillerJLabel; westListJPanel = new PanelCellListJPanel(westListModel, ListType.WEST_LIST); westFillerJLabel = new javax.swing.JLabel(); eastListJPanel = new PanelCellListJPanel(eastListModel, ListType.EAST_LIST); eastFillerJLabel = new javax.swing.JLabel(); setLayout(new java.awt.GridBagLayout()); setBorder(BORDER); collapsedJPanel.setLayout(new java.awt.GridBagLayout()); collapsedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { collapsedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { collapsedJPanelMouseReleased(e); } }); iconJLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/IconContainer.png"))); iconJLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent e) { iconJLabelMouseEntered(e); } public void mouseExited(java.awt.event.MouseEvent e) { iconJLabelMouseExited(e); } public void mousePressed(java.awt.event.MouseEvent e) { iconJLabelMousePressed(e); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; gridBagConstraints.insets = new java.awt.Insets(4, 32, 0, 5); collapsedJPanel.add(iconJLabel, gridBagConstraints); textJLabel.setText("!Package Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.insets = new java.awt.Insets(5, 3, 4, 0); collapsedJPanel.add(textJLabel, gridBagConstraints); additionalTextJLabel.setForeground(Colors.Browser.List.INNER_LIST_SELECTION_BORDER); additionalTextJLabel.setText("!Package Additional Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 4, 0); collapsedJPanel.add(additionalTextJLabel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(collapsedJPanel, gridBagConstraints); expandedJPanel.setLayout(new java.awt.GridLayout(1, 0)); expandedJPanel.setOpaque(false); expandedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { expandedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { expandedJPanelMouseReleased(e); } }); westJPanel.setLayout(new java.awt.GridBagLayout()); westJPanel.setOpaque(false); westListJPanel.setLayout(new java.awt.GridBagLayout()); westListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; westJPanel.add(westListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); westJPanel.add(westFillerJLabel, gridBagConstraints); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("localization/ListItem_Messages"); // NOI18N westFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 5); westJPanel.add(westFirstJLabel, gridBagConstraints); westPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westPreviousJLabel, gridBagConstraints); westCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westCountJLabel, gridBagConstraints); westNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westNextJLabel, gridBagConstraints); westLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westLastJLabel, gridBagConstraints); expandedJPanel.add(westJPanel); eastJPanel.setLayout(new java.awt.GridBagLayout()); eastJPanel.setOpaque(false); eastListJPanel.setLayout(new java.awt.GridBagLayout()); eastListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; eastJPanel.add(eastListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); eastJPanel.add(eastFillerJLabel, gridBagConstraints); eastFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastFirstJLabel, gridBagConstraints); eastPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastPreviousJLabel, gridBagConstraints); eastCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastCountJLabel, gridBagConstraints); eastNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastNextJLabel, gridBagConstraints); eastLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastLastJLabel, gridBagConstraints); expandedJPanel.add(eastJPanel); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(expandedJPanel, gridBagConstraints); }// </editor-fold>//GEN-END:initComponents
private void initComponents() { javax.swing.JLabel eastFillerJLabel; java.awt.GridBagConstraints gridBagConstraints; javax.swing.JLabel westFillerJLabel; westListJPanel = new PanelCellListJPanel(westListModel, ListType.WEST_LIST); westFillerJLabel = new javax.swing.JLabel(); eastListJPanel = new PanelCellListJPanel(eastListModel, ListType.EAST_LIST); eastFillerJLabel = new javax.swing.JLabel(); setLayout(new java.awt.GridBagLayout()); setBorder(BORDER); collapsedJPanel.setLayout(new java.awt.GridBagLayout()); collapsedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { collapsedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { collapsedJPanelMouseReleased(e); } }); iconJLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/IconContainer.png"))); iconJLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent e) { iconJLabelMouseEntered(e); } public void mouseExited(java.awt.event.MouseEvent e) { iconJLabelMouseExited(e); } public void mousePressed(java.awt.event.MouseEvent e) { iconJLabelMousePressed(e); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; gridBagConstraints.insets = new java.awt.Insets(4, 32, 0, 5); collapsedJPanel.add(iconJLabel, gridBagConstraints); textJLabel.setText("!Package Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.insets = new java.awt.Insets(5, 3, 4, 0); collapsedJPanel.add(textJLabel, gridBagConstraints); additionalTextJLabel.setForeground(Colors.Browser.List.INNER_LIST_SELECTION_BORDER); additionalTextJLabel.setText("!Package Additional Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 4, 0); collapsedJPanel.add(additionalTextJLabel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(collapsedJPanel, gridBagConstraints); expandedJPanel.setLayout(new java.awt.GridLayout(1, 0)); expandedJPanel.setOpaque(false); expandedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { expandedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { expandedJPanelMouseReleased(e); } }); westJPanel.setLayout(new java.awt.GridBagLayout()); westJPanel.setOpaque(false); westListJPanel.setLayout(new java.awt.GridBagLayout()); westListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; westJPanel.add(westListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); westJPanel.add(westFillerJLabel, gridBagConstraints); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("localization/ListItem_Messages"); // NOI18N westFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 5); westJPanel.add(westFirstJLabel, gridBagConstraints); westPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westPreviousJLabel, gridBagConstraints); westCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westCountJLabel, gridBagConstraints); westNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westNextJLabel, gridBagConstraints); westLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westLastJLabel, gridBagConstraints); expandedJPanel.add(westJPanel); eastJPanel.setLayout(new java.awt.GridBagLayout()); eastJPanel.setOpaque(false); eastListJPanel.setLayout(new java.awt.GridBagLayout()); eastListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; eastJPanel.add(eastListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); eastJPanel.add(eastFillerJLabel, gridBagConstraints); eastFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastFirstJLabel, gridBagConstraints); eastPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastPreviousJLabel, gridBagConstraints); eastCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastCountJLabel, gridBagConstraints); eastNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastNextJLabel, gridBagConstraints); eastLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastLastJLabel, gridBagConstraints); expandedJPanel.add(eastJPanel); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(expandedJPanel, gridBagConstraints); }// </editor-fold>//GEN-END:initComponents
1,114,773
private void initComponents() { javax.swing.JLabel eastFillerJLabel; java.awt.GridBagConstraints gridBagConstraints; javax.swing.JLabel westFillerJLabel; westListJPanel = new PanelCellListJPanel(westListModel, ListType.WEST_LIST); westFillerJLabel = new javax.swing.JLabel(); eastListJPanel = new PanelCellListJPanel(eastListModel, ListType.EAST_LIST); eastFillerJLabel = new javax.swing.JLabel(); setLayout(new java.awt.GridBagLayout()); setBorder(BORDER); collapsedJPanel.setLayout(new java.awt.GridBagLayout()); collapsedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { collapsedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { collapsedJPanelMouseReleased(e); } }); iconJLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/IconContainer.png"))); iconJLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent e) { iconJLabelMouseEntered(e); } public void mouseExited(java.awt.event.MouseEvent e) { iconJLabelMouseExited(e); } public void mousePressed(java.awt.event.MouseEvent e) { iconJLabelMousePressed(e); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; gridBagConstraints.insets = new java.awt.Insets(4, 32, 0, 5); collapsedJPanel.add(iconJLabel, gridBagConstraints); textJLabel.setText("!Package Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.insets = new java.awt.Insets(5, 3, 4, 0); collapsedJPanel.add(textJLabel, gridBagConstraints); additionalTextJLabel.setForeground(Colors.Browser.List.INNER_LIST_SELECTION_BORDER); additionalTextJLabel.setText("!Package Additional Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 4, 0); collapsedJPanel.add(additionalTextJLabel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(collapsedJPanel, gridBagConstraints); expandedJPanel.setLayout(new java.awt.GridLayout(1, 0)); expandedJPanel.setOpaque(false); expandedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { expandedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { expandedJPanelMouseReleased(e); } }); westJPanel.setLayout(new java.awt.GridBagLayout()); westJPanel.setOpaque(false); westListJPanel.setLayout(new java.awt.GridBagLayout()); westListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; westJPanel.add(westListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); westJPanel.add(westFillerJLabel, gridBagConstraints); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("localization/ListItem_Messages"); // NOI18N westFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 5); westJPanel.add(westFirstJLabel, gridBagConstraints); westPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westPreviousJLabel, gridBagConstraints); westCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westCountJLabel, gridBagConstraints); westNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westNextJLabel, gridBagConstraints); westLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westLastJLabel, gridBagConstraints); expandedJPanel.add(westJPanel); eastJPanel.setLayout(new java.awt.GridBagLayout()); eastJPanel.setOpaque(false); eastListJPanel.setLayout(new java.awt.GridBagLayout()); eastListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; eastJPanel.add(eastListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); eastJPanel.add(eastFillerJLabel, gridBagConstraints); eastFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastFirstJLabel, gridBagConstraints); eastPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastPreviousJLabel, gridBagConstraints); eastCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastCountJLabel, gridBagConstraints); eastNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastNextJLabel, gridBagConstraints); eastLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastLastJLabel, gridBagConstraints); expandedJPanel.add(eastJPanel); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(expandedJPanel, gridBagConstraints); }// </editor-fold>//GEN-END:initComponents
private void initComponents() { javax.swing.JLabel eastFillerJLabel; java.awt.GridBagConstraints gridBagConstraints; javax.swing.JLabel westFillerJLabel; westListJPanel = new PanelCellListJPanel(westListModel, ListType.WEST_LIST); westFillerJLabel = new javax.swing.JLabel(); eastListJPanel = new PanelCellListJPanel(eastListModel, ListType.EAST_LIST); eastFillerJLabel = new javax.swing.JLabel(); setLayout(new java.awt.GridBagLayout()); setBorder(BORDER); collapsedJPanel.setLayout(new java.awt.GridBagLayout()); collapsedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { collapsedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { collapsedJPanelMouseReleased(e); } }); iconJLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/IconContainer.png"))); iconJLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent e) { iconJLabelMouseEntered(e); } public void mouseExited(java.awt.event.MouseEvent e) { iconJLabelMouseExited(e); } public void mousePressed(java.awt.event.MouseEvent e) { iconJLabelMousePressed(e); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; gridBagConstraints.insets = new java.awt.Insets(4, 32, 0, 5); collapsedJPanel.add(iconJLabel, gridBagConstraints); textJLabel.setText("!Package Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.insets = new java.awt.Insets(5, 3, 4, 0); collapsedJPanel.add(textJLabel, gridBagConstraints); additionalTextJLabel.setForeground(Colors.Browser.List.INNER_LIST_SELECTION_BORDER); additionalTextJLabel.setText("!Package Additional Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 4, 0); collapsedJPanel.add(additionalTextJLabel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(collapsedJPanel, gridBagConstraints); expandedJPanel.setLayout(new java.awt.GridLayout(1, 0)); expandedJPanel.setOpaque(false); expandedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { expandedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { expandedJPanelMouseReleased(e); } }); westJPanel.setLayout(new java.awt.GridBagLayout()); westJPanel.setOpaque(false); westListJPanel.setLayout(new java.awt.GridBagLayout()); westListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; westJPanel.add(westListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); westJPanel.add(westFillerJLabel, gridBagConstraints); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("localization/ListItem_Messages"); // NOI18N westFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 5); westJPanel.add(westFirstJLabel, gridBagConstraints); westPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westPreviousJLabel, gridBagConstraints); westCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westCountJLabel, gridBagConstraints); westNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westNextJLabel, gridBagConstraints); westLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westLastJLabel, gridBagConstraints); expandedJPanel.add(westJPanel); eastJPanel.setLayout(new java.awt.GridBagLayout()); eastJPanel.setOpaque(false); eastListJPanel.setLayout(new java.awt.GridBagLayout()); eastListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; eastJPanel.add(eastListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); eastJPanel.add(eastFillerJLabel, gridBagConstraints); eastFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastFirstJLabel, gridBagConstraints); eastPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastPreviousJLabel, gridBagConstraints); eastCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastCountJLabel, gridBagConstraints); eastNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastNextJLabel, gridBagConstraints); eastLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastLastJLabel, gridBagConstraints); expandedJPanel.add(eastJPanel); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(expandedJPanel, gridBagConstraints); }// </editor-fold>//GEN-END:initComponents
1,114,774
private void initComponents() { javax.swing.JLabel eastFillerJLabel; java.awt.GridBagConstraints gridBagConstraints; javax.swing.JLabel westFillerJLabel; westListJPanel = new PanelCellListJPanel(westListModel, ListType.WEST_LIST); westFillerJLabel = new javax.swing.JLabel(); eastListJPanel = new PanelCellListJPanel(eastListModel, ListType.EAST_LIST); eastFillerJLabel = new javax.swing.JLabel(); setLayout(new java.awt.GridBagLayout()); setBorder(BORDER); collapsedJPanel.setLayout(new java.awt.GridBagLayout()); collapsedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { collapsedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { collapsedJPanelMouseReleased(e); } }); iconJLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/IconContainer.png"))); iconJLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent e) { iconJLabelMouseEntered(e); } public void mouseExited(java.awt.event.MouseEvent e) { iconJLabelMouseExited(e); } public void mousePressed(java.awt.event.MouseEvent e) { iconJLabelMousePressed(e); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; gridBagConstraints.insets = new java.awt.Insets(4, 32, 0, 5); collapsedJPanel.add(iconJLabel, gridBagConstraints); textJLabel.setText("!Package Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.insets = new java.awt.Insets(5, 3, 4, 0); collapsedJPanel.add(textJLabel, gridBagConstraints); additionalTextJLabel.setForeground(Colors.Browser.List.INNER_LIST_SELECTION_BORDER); additionalTextJLabel.setText("!Package Additional Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 4, 0); collapsedJPanel.add(additionalTextJLabel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(collapsedJPanel, gridBagConstraints); expandedJPanel.setLayout(new java.awt.GridLayout(1, 0)); expandedJPanel.setOpaque(false); expandedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { expandedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { expandedJPanelMouseReleased(e); } }); westJPanel.setLayout(new java.awt.GridBagLayout()); westJPanel.setOpaque(false); westListJPanel.setLayout(new java.awt.GridBagLayout()); westListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; westJPanel.add(westListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); westJPanel.add(westFillerJLabel, gridBagConstraints); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("localization/ListItem_Messages"); // NOI18N westFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 5); westJPanel.add(westFirstJLabel, gridBagConstraints); westPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westPreviousJLabel, gridBagConstraints); westCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westCountJLabel, gridBagConstraints); westNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westNextJLabel, gridBagConstraints); westLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westLastJLabel, gridBagConstraints); expandedJPanel.add(westJPanel); eastJPanel.setLayout(new java.awt.GridBagLayout()); eastJPanel.setOpaque(false); eastListJPanel.setLayout(new java.awt.GridBagLayout()); eastListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; eastJPanel.add(eastListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); eastJPanel.add(eastFillerJLabel, gridBagConstraints); eastFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastFirstJLabel, gridBagConstraints); eastPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastPreviousJLabel, gridBagConstraints); eastCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastCountJLabel, gridBagConstraints); eastNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastNextJLabel, gridBagConstraints); eastLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastLastJLabel, gridBagConstraints); expandedJPanel.add(eastJPanel); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(expandedJPanel, gridBagConstraints); }// </editor-fold>//GEN-END:initComponents
private void initComponents() { javax.swing.JLabel eastFillerJLabel; java.awt.GridBagConstraints gridBagConstraints; javax.swing.JLabel westFillerJLabel; westListJPanel = new PanelCellListJPanel(westListModel, ListType.WEST_LIST); westFillerJLabel = new javax.swing.JLabel(); eastListJPanel = new PanelCellListJPanel(eastListModel, ListType.EAST_LIST); eastFillerJLabel = new javax.swing.JLabel(); setLayout(new java.awt.GridBagLayout()); setBorder(BORDER); collapsedJPanel.setLayout(new java.awt.GridBagLayout()); collapsedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { collapsedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { collapsedJPanelMouseReleased(e); } }); iconJLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/IconContainer.png"))); iconJLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent e) { iconJLabelMouseEntered(e); } public void mouseExited(java.awt.event.MouseEvent e) { iconJLabelMouseExited(e); } public void mousePressed(java.awt.event.MouseEvent e) { iconJLabelMousePressed(e); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; gridBagConstraints.insets = new java.awt.Insets(4, 32, 0, 5); collapsedJPanel.add(iconJLabel, gridBagConstraints); textJLabel.setText("!Package Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.insets = new java.awt.Insets(5, 3, 4, 0); collapsedJPanel.add(textJLabel, gridBagConstraints); additionalTextJLabel.setForeground(Colors.Browser.List.INNER_LIST_SELECTION_BORDER); additionalTextJLabel.setText("!Package Additional Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 4, 0); collapsedJPanel.add(additionalTextJLabel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(collapsedJPanel, gridBagConstraints); expandedJPanel.setLayout(new java.awt.GridLayout(1, 0)); expandedJPanel.setOpaque(false); expandedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { expandedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { expandedJPanelMouseReleased(e); } }); westJPanel.setLayout(new java.awt.GridBagLayout()); westJPanel.setOpaque(false); westListJPanel.setLayout(new java.awt.GridBagLayout()); westListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; westJPanel.add(westListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); westJPanel.add(westFillerJLabel, gridBagConstraints); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("localization/ListItem_Messages"); // NOI18N westFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 5); westJPanel.add(westFirstJLabel, gridBagConstraints); westPreviousJLabel.setText(java.util.ResourceBundle.getBundle("localization/ListItem_Messages").getString("ContainerPanel.previousJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westPreviousJLabel, gridBagConstraints); westCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westCountJLabel, gridBagConstraints); westNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westNextJLabel, gridBagConstraints); westLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westLastJLabel, gridBagConstraints); expandedJPanel.add(westJPanel); eastJPanel.setLayout(new java.awt.GridBagLayout()); eastJPanel.setOpaque(false); eastListJPanel.setLayout(new java.awt.GridBagLayout()); eastListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; eastJPanel.add(eastListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); eastJPanel.add(eastFillerJLabel, gridBagConstraints); eastFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastFirstJLabel, gridBagConstraints); eastPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastPreviousJLabel, gridBagConstraints); eastCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastCountJLabel, gridBagConstraints); eastNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastNextJLabel, gridBagConstraints); eastLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastLastJLabel, gridBagConstraints); expandedJPanel.add(eastJPanel); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(expandedJPanel, gridBagConstraints); }// </editor-fold>//GEN-END:initComponents
1,114,775
private void initComponents() { javax.swing.JLabel eastFillerJLabel; java.awt.GridBagConstraints gridBagConstraints; javax.swing.JLabel westFillerJLabel; westListJPanel = new PanelCellListJPanel(westListModel, ListType.WEST_LIST); westFillerJLabel = new javax.swing.JLabel(); eastListJPanel = new PanelCellListJPanel(eastListModel, ListType.EAST_LIST); eastFillerJLabel = new javax.swing.JLabel(); setLayout(new java.awt.GridBagLayout()); setBorder(BORDER); collapsedJPanel.setLayout(new java.awt.GridBagLayout()); collapsedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { collapsedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { collapsedJPanelMouseReleased(e); } }); iconJLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/IconContainer.png"))); iconJLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent e) { iconJLabelMouseEntered(e); } public void mouseExited(java.awt.event.MouseEvent e) { iconJLabelMouseExited(e); } public void mousePressed(java.awt.event.MouseEvent e) { iconJLabelMousePressed(e); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; gridBagConstraints.insets = new java.awt.Insets(4, 32, 0, 5); collapsedJPanel.add(iconJLabel, gridBagConstraints); textJLabel.setText("!Package Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.insets = new java.awt.Insets(5, 3, 4, 0); collapsedJPanel.add(textJLabel, gridBagConstraints); additionalTextJLabel.setForeground(Colors.Browser.List.INNER_LIST_SELECTION_BORDER); additionalTextJLabel.setText("!Package Additional Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 4, 0); collapsedJPanel.add(additionalTextJLabel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(collapsedJPanel, gridBagConstraints); expandedJPanel.setLayout(new java.awt.GridLayout(1, 0)); expandedJPanel.setOpaque(false); expandedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { expandedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { expandedJPanelMouseReleased(e); } }); westJPanel.setLayout(new java.awt.GridBagLayout()); westJPanel.setOpaque(false); westListJPanel.setLayout(new java.awt.GridBagLayout()); westListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; westJPanel.add(westListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); westJPanel.add(westFillerJLabel, gridBagConstraints); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("localization/ListItem_Messages"); // NOI18N westFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 5); westJPanel.add(westFirstJLabel, gridBagConstraints); westPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westPreviousJLabel, gridBagConstraints); westCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westCountJLabel, gridBagConstraints); westNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westNextJLabel, gridBagConstraints); westLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westLastJLabel, gridBagConstraints); expandedJPanel.add(westJPanel); eastJPanel.setLayout(new java.awt.GridBagLayout()); eastJPanel.setOpaque(false); eastListJPanel.setLayout(new java.awt.GridBagLayout()); eastListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; eastJPanel.add(eastListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); eastJPanel.add(eastFillerJLabel, gridBagConstraints); eastFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastFirstJLabel, gridBagConstraints); eastPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastPreviousJLabel, gridBagConstraints); eastCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastCountJLabel, gridBagConstraints); eastNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastNextJLabel, gridBagConstraints); eastLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastLastJLabel, gridBagConstraints); expandedJPanel.add(eastJPanel); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(expandedJPanel, gridBagConstraints); }// </editor-fold>//GEN-END:initComponents
private void initComponents() { javax.swing.JLabel eastFillerJLabel; java.awt.GridBagConstraints gridBagConstraints; javax.swing.JLabel westFillerJLabel; westListJPanel = new PanelCellListJPanel(westListModel, ListType.WEST_LIST); westFillerJLabel = new javax.swing.JLabel(); eastListJPanel = new PanelCellListJPanel(eastListModel, ListType.EAST_LIST); eastFillerJLabel = new javax.swing.JLabel(); setLayout(new java.awt.GridBagLayout()); setBorder(BORDER); collapsedJPanel.setLayout(new java.awt.GridBagLayout()); collapsedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { collapsedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { collapsedJPanelMouseReleased(e); } }); iconJLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/IconContainer.png"))); iconJLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent e) { iconJLabelMouseEntered(e); } public void mouseExited(java.awt.event.MouseEvent e) { iconJLabelMouseExited(e); } public void mousePressed(java.awt.event.MouseEvent e) { iconJLabelMousePressed(e); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; gridBagConstraints.insets = new java.awt.Insets(4, 32, 0, 5); collapsedJPanel.add(iconJLabel, gridBagConstraints); textJLabel.setText("!Package Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.insets = new java.awt.Insets(5, 3, 4, 0); collapsedJPanel.add(textJLabel, gridBagConstraints); additionalTextJLabel.setForeground(Colors.Browser.List.INNER_LIST_SELECTION_BORDER); additionalTextJLabel.setText("!Package Additional Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 4, 0); collapsedJPanel.add(additionalTextJLabel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(collapsedJPanel, gridBagConstraints); expandedJPanel.setLayout(new java.awt.GridLayout(1, 0)); expandedJPanel.setOpaque(false); expandedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { expandedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { expandedJPanelMouseReleased(e); } }); westJPanel.setLayout(new java.awt.GridBagLayout()); westJPanel.setOpaque(false); westListJPanel.setLayout(new java.awt.GridBagLayout()); westListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; westJPanel.add(westListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); westJPanel.add(westFillerJLabel, gridBagConstraints); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("localization/ListItem_Messages"); // NOI18N westFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 5); westJPanel.add(westFirstJLabel, gridBagConstraints); westPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westPreviousJLabel, gridBagConstraints); westCountJLabel.setText(java.util.ResourceBundle.getBundle("localization/ListItem_Messages").getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westCountJLabel, gridBagConstraints); westNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westNextJLabel, gridBagConstraints); westLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westLastJLabel, gridBagConstraints); expandedJPanel.add(westJPanel); eastJPanel.setLayout(new java.awt.GridBagLayout()); eastJPanel.setOpaque(false); eastListJPanel.setLayout(new java.awt.GridBagLayout()); eastListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; eastJPanel.add(eastListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); eastJPanel.add(eastFillerJLabel, gridBagConstraints); eastFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastFirstJLabel, gridBagConstraints); eastPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastPreviousJLabel, gridBagConstraints); eastCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastCountJLabel, gridBagConstraints); eastNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastNextJLabel, gridBagConstraints); eastLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastLastJLabel, gridBagConstraints); expandedJPanel.add(eastJPanel); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(expandedJPanel, gridBagConstraints); }// </editor-fold>//GEN-END:initComponents
1,114,776
private void initComponents() { javax.swing.JLabel eastFillerJLabel; java.awt.GridBagConstraints gridBagConstraints; javax.swing.JLabel westFillerJLabel; westListJPanel = new PanelCellListJPanel(westListModel, ListType.WEST_LIST); westFillerJLabel = new javax.swing.JLabel(); eastListJPanel = new PanelCellListJPanel(eastListModel, ListType.EAST_LIST); eastFillerJLabel = new javax.swing.JLabel(); setLayout(new java.awt.GridBagLayout()); setBorder(BORDER); collapsedJPanel.setLayout(new java.awt.GridBagLayout()); collapsedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { collapsedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { collapsedJPanelMouseReleased(e); } }); iconJLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/IconContainer.png"))); iconJLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent e) { iconJLabelMouseEntered(e); } public void mouseExited(java.awt.event.MouseEvent e) { iconJLabelMouseExited(e); } public void mousePressed(java.awt.event.MouseEvent e) { iconJLabelMousePressed(e); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; gridBagConstraints.insets = new java.awt.Insets(4, 32, 0, 5); collapsedJPanel.add(iconJLabel, gridBagConstraints); textJLabel.setText("!Package Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.insets = new java.awt.Insets(5, 3, 4, 0); collapsedJPanel.add(textJLabel, gridBagConstraints); additionalTextJLabel.setForeground(Colors.Browser.List.INNER_LIST_SELECTION_BORDER); additionalTextJLabel.setText("!Package Additional Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 4, 0); collapsedJPanel.add(additionalTextJLabel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(collapsedJPanel, gridBagConstraints); expandedJPanel.setLayout(new java.awt.GridLayout(1, 0)); expandedJPanel.setOpaque(false); expandedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { expandedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { expandedJPanelMouseReleased(e); } }); westJPanel.setLayout(new java.awt.GridBagLayout()); westJPanel.setOpaque(false); westListJPanel.setLayout(new java.awt.GridBagLayout()); westListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; westJPanel.add(westListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); westJPanel.add(westFillerJLabel, gridBagConstraints); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("localization/ListItem_Messages"); // NOI18N westFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 5); westJPanel.add(westFirstJLabel, gridBagConstraints); westPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westPreviousJLabel, gridBagConstraints); westCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westCountJLabel, gridBagConstraints); westNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westNextJLabel, gridBagConstraints); westLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westLastJLabel, gridBagConstraints); expandedJPanel.add(westJPanel); eastJPanel.setLayout(new java.awt.GridBagLayout()); eastJPanel.setOpaque(false); eastListJPanel.setLayout(new java.awt.GridBagLayout()); eastListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; eastJPanel.add(eastListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); eastJPanel.add(eastFillerJLabel, gridBagConstraints); eastFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastFirstJLabel, gridBagConstraints); eastPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastPreviousJLabel, gridBagConstraints); eastCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastCountJLabel, gridBagConstraints); eastNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastNextJLabel, gridBagConstraints); eastLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastLastJLabel, gridBagConstraints); expandedJPanel.add(eastJPanel); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(expandedJPanel, gridBagConstraints); }// </editor-fold>//GEN-END:initComponents
private void initComponents() { javax.swing.JLabel eastFillerJLabel; java.awt.GridBagConstraints gridBagConstraints; javax.swing.JLabel westFillerJLabel; westListJPanel = new PanelCellListJPanel(westListModel, ListType.WEST_LIST); westFillerJLabel = new javax.swing.JLabel(); eastListJPanel = new PanelCellListJPanel(eastListModel, ListType.EAST_LIST); eastFillerJLabel = new javax.swing.JLabel(); setLayout(new java.awt.GridBagLayout()); setBorder(BORDER); collapsedJPanel.setLayout(new java.awt.GridBagLayout()); collapsedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { collapsedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { collapsedJPanelMouseReleased(e); } }); iconJLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/IconContainer.png"))); iconJLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent e) { iconJLabelMouseEntered(e); } public void mouseExited(java.awt.event.MouseEvent e) { iconJLabelMouseExited(e); } public void mousePressed(java.awt.event.MouseEvent e) { iconJLabelMousePressed(e); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; gridBagConstraints.insets = new java.awt.Insets(4, 32, 0, 5); collapsedJPanel.add(iconJLabel, gridBagConstraints); textJLabel.setText("!Package Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.insets = new java.awt.Insets(5, 3, 4, 0); collapsedJPanel.add(textJLabel, gridBagConstraints); additionalTextJLabel.setForeground(Colors.Browser.List.INNER_LIST_SELECTION_BORDER); additionalTextJLabel.setText("!Package Additional Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 4, 0); collapsedJPanel.add(additionalTextJLabel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(collapsedJPanel, gridBagConstraints); expandedJPanel.setLayout(new java.awt.GridLayout(1, 0)); expandedJPanel.setOpaque(false); expandedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { expandedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { expandedJPanelMouseReleased(e); } }); westJPanel.setLayout(new java.awt.GridBagLayout()); westJPanel.setOpaque(false); westListJPanel.setLayout(new java.awt.GridBagLayout()); westListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; westJPanel.add(westListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); westJPanel.add(westFillerJLabel, gridBagConstraints); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("localization/ListItem_Messages"); // NOI18N westFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 5); westJPanel.add(westFirstJLabel, gridBagConstraints); westPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westPreviousJLabel, gridBagConstraints); westCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westCountJLabel, gridBagConstraints); westNextJLabel.setText(java.util.ResourceBundle.getBundle("localization/ListItem_Messages").getString("ContainerPanel.nextJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westNextJLabel, gridBagConstraints); westLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westLastJLabel, gridBagConstraints); expandedJPanel.add(westJPanel); eastJPanel.setLayout(new java.awt.GridBagLayout()); eastJPanel.setOpaque(false); eastListJPanel.setLayout(new java.awt.GridBagLayout()); eastListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; eastJPanel.add(eastListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); eastJPanel.add(eastFillerJLabel, gridBagConstraints); eastFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastFirstJLabel, gridBagConstraints); eastPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastPreviousJLabel, gridBagConstraints); eastCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastCountJLabel, gridBagConstraints); eastNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastNextJLabel, gridBagConstraints); eastLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastLastJLabel, gridBagConstraints); expandedJPanel.add(eastJPanel); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(expandedJPanel, gridBagConstraints); }// </editor-fold>//GEN-END:initComponents
1,114,777
private void initComponents() { javax.swing.JLabel eastFillerJLabel; java.awt.GridBagConstraints gridBagConstraints; javax.swing.JLabel westFillerJLabel; westListJPanel = new PanelCellListJPanel(westListModel, ListType.WEST_LIST); westFillerJLabel = new javax.swing.JLabel(); eastListJPanel = new PanelCellListJPanel(eastListModel, ListType.EAST_LIST); eastFillerJLabel = new javax.swing.JLabel(); setLayout(new java.awt.GridBagLayout()); setBorder(BORDER); collapsedJPanel.setLayout(new java.awt.GridBagLayout()); collapsedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { collapsedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { collapsedJPanelMouseReleased(e); } }); iconJLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/IconContainer.png"))); iconJLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent e) { iconJLabelMouseEntered(e); } public void mouseExited(java.awt.event.MouseEvent e) { iconJLabelMouseExited(e); } public void mousePressed(java.awt.event.MouseEvent e) { iconJLabelMousePressed(e); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; gridBagConstraints.insets = new java.awt.Insets(4, 32, 0, 5); collapsedJPanel.add(iconJLabel, gridBagConstraints); textJLabel.setText("!Package Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.insets = new java.awt.Insets(5, 3, 4, 0); collapsedJPanel.add(textJLabel, gridBagConstraints); additionalTextJLabel.setForeground(Colors.Browser.List.INNER_LIST_SELECTION_BORDER); additionalTextJLabel.setText("!Package Additional Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 4, 0); collapsedJPanel.add(additionalTextJLabel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(collapsedJPanel, gridBagConstraints); expandedJPanel.setLayout(new java.awt.GridLayout(1, 0)); expandedJPanel.setOpaque(false); expandedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { expandedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { expandedJPanelMouseReleased(e); } }); westJPanel.setLayout(new java.awt.GridBagLayout()); westJPanel.setOpaque(false); westListJPanel.setLayout(new java.awt.GridBagLayout()); westListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; westJPanel.add(westListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); westJPanel.add(westFillerJLabel, gridBagConstraints); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("localization/ListItem_Messages"); // NOI18N westFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 5); westJPanel.add(westFirstJLabel, gridBagConstraints); westPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westPreviousJLabel, gridBagConstraints); westCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westCountJLabel, gridBagConstraints); westNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westNextJLabel, gridBagConstraints); westLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westLastJLabel, gridBagConstraints); expandedJPanel.add(westJPanel); eastJPanel.setLayout(new java.awt.GridBagLayout()); eastJPanel.setOpaque(false); eastListJPanel.setLayout(new java.awt.GridBagLayout()); eastListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; eastJPanel.add(eastListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); eastJPanel.add(eastFillerJLabel, gridBagConstraints); eastFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastFirstJLabel, gridBagConstraints); eastPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastPreviousJLabel, gridBagConstraints); eastCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastCountJLabel, gridBagConstraints); eastNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastNextJLabel, gridBagConstraints); eastLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastLastJLabel, gridBagConstraints); expandedJPanel.add(eastJPanel); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(expandedJPanel, gridBagConstraints); }// </editor-fold>//GEN-END:initComponents
private void initComponents() { javax.swing.JLabel eastFillerJLabel; java.awt.GridBagConstraints gridBagConstraints; javax.swing.JLabel westFillerJLabel; westListJPanel = new PanelCellListJPanel(westListModel, ListType.WEST_LIST); westFillerJLabel = new javax.swing.JLabel(); eastListJPanel = new PanelCellListJPanel(eastListModel, ListType.EAST_LIST); eastFillerJLabel = new javax.swing.JLabel(); setLayout(new java.awt.GridBagLayout()); setBorder(BORDER); collapsedJPanel.setLayout(new java.awt.GridBagLayout()); collapsedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { collapsedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { collapsedJPanelMouseReleased(e); } }); iconJLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/IconContainer.png"))); iconJLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent e) { iconJLabelMouseEntered(e); } public void mouseExited(java.awt.event.MouseEvent e) { iconJLabelMouseExited(e); } public void mousePressed(java.awt.event.MouseEvent e) { iconJLabelMousePressed(e); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; gridBagConstraints.insets = new java.awt.Insets(4, 32, 0, 5); collapsedJPanel.add(iconJLabel, gridBagConstraints); textJLabel.setText("!Package Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.insets = new java.awt.Insets(5, 3, 4, 0); collapsedJPanel.add(textJLabel, gridBagConstraints); additionalTextJLabel.setForeground(Colors.Browser.List.INNER_LIST_SELECTION_BORDER); additionalTextJLabel.setText("!Package Additional Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 4, 0); collapsedJPanel.add(additionalTextJLabel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(collapsedJPanel, gridBagConstraints); expandedJPanel.setLayout(new java.awt.GridLayout(1, 0)); expandedJPanel.setOpaque(false); expandedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { expandedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { expandedJPanelMouseReleased(e); } }); westJPanel.setLayout(new java.awt.GridBagLayout()); westJPanel.setOpaque(false); westListJPanel.setLayout(new java.awt.GridBagLayout()); westListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; westJPanel.add(westListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); westJPanel.add(westFillerJLabel, gridBagConstraints); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("localization/ListItem_Messages"); // NOI18N westFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 5); westJPanel.add(westFirstJLabel, gridBagConstraints); westPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westPreviousJLabel, gridBagConstraints); westCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westCountJLabel, gridBagConstraints); westNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westNextJLabel, gridBagConstraints); westLastJLabel.setText(java.util.ResourceBundle.getBundle("localization/ListItem_Messages").getString("ContainerPanel.lastJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westLastJLabel, gridBagConstraints); expandedJPanel.add(westJPanel); eastJPanel.setLayout(new java.awt.GridBagLayout()); eastJPanel.setOpaque(false); eastListJPanel.setLayout(new java.awt.GridBagLayout()); eastListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; eastJPanel.add(eastListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); eastJPanel.add(eastFillerJLabel, gridBagConstraints); eastFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastFirstJLabel, gridBagConstraints); eastPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastPreviousJLabel, gridBagConstraints); eastCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastCountJLabel, gridBagConstraints); eastNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastNextJLabel, gridBagConstraints); eastLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastLastJLabel, gridBagConstraints); expandedJPanel.add(eastJPanel); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(expandedJPanel, gridBagConstraints); }// </editor-fold>//GEN-END:initComponents
1,114,778
private void initComponents() { javax.swing.JLabel eastFillerJLabel; java.awt.GridBagConstraints gridBagConstraints; javax.swing.JLabel westFillerJLabel; westListJPanel = new PanelCellListJPanel(westListModel, ListType.WEST_LIST); westFillerJLabel = new javax.swing.JLabel(); eastListJPanel = new PanelCellListJPanel(eastListModel, ListType.EAST_LIST); eastFillerJLabel = new javax.swing.JLabel(); setLayout(new java.awt.GridBagLayout()); setBorder(BORDER); collapsedJPanel.setLayout(new java.awt.GridBagLayout()); collapsedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { collapsedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { collapsedJPanelMouseReleased(e); } }); iconJLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/IconContainer.png"))); iconJLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent e) { iconJLabelMouseEntered(e); } public void mouseExited(java.awt.event.MouseEvent e) { iconJLabelMouseExited(e); } public void mousePressed(java.awt.event.MouseEvent e) { iconJLabelMousePressed(e); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; gridBagConstraints.insets = new java.awt.Insets(4, 32, 0, 5); collapsedJPanel.add(iconJLabel, gridBagConstraints); textJLabel.setText("!Package Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.insets = new java.awt.Insets(5, 3, 4, 0); collapsedJPanel.add(textJLabel, gridBagConstraints); additionalTextJLabel.setForeground(Colors.Browser.List.INNER_LIST_SELECTION_BORDER); additionalTextJLabel.setText("!Package Additional Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 4, 0); collapsedJPanel.add(additionalTextJLabel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(collapsedJPanel, gridBagConstraints); expandedJPanel.setLayout(new java.awt.GridLayout(1, 0)); expandedJPanel.setOpaque(false); expandedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { expandedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { expandedJPanelMouseReleased(e); } }); westJPanel.setLayout(new java.awt.GridBagLayout()); westJPanel.setOpaque(false); westListJPanel.setLayout(new java.awt.GridBagLayout()); westListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; westJPanel.add(westListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); westJPanel.add(westFillerJLabel, gridBagConstraints); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("localization/ListItem_Messages"); // NOI18N westFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 5); westJPanel.add(westFirstJLabel, gridBagConstraints); westPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westPreviousJLabel, gridBagConstraints); westCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westCountJLabel, gridBagConstraints); westNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westNextJLabel, gridBagConstraints); westLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westLastJLabel, gridBagConstraints); expandedJPanel.add(westJPanel); eastJPanel.setLayout(new java.awt.GridBagLayout()); eastJPanel.setOpaque(false); eastListJPanel.setLayout(new java.awt.GridBagLayout()); eastListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; eastJPanel.add(eastListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); eastJPanel.add(eastFillerJLabel, gridBagConstraints); eastFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastFirstJLabel, gridBagConstraints); eastPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastPreviousJLabel, gridBagConstraints); eastCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastCountJLabel, gridBagConstraints); eastNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastNextJLabel, gridBagConstraints); eastLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastLastJLabel, gridBagConstraints); expandedJPanel.add(eastJPanel); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(expandedJPanel, gridBagConstraints); }// </editor-fold>//GEN-END:initComponents
private void initComponents() { javax.swing.JLabel eastFillerJLabel; java.awt.GridBagConstraints gridBagConstraints; javax.swing.JLabel westFillerJLabel; westListJPanel = new PanelCellListJPanel(westListModel, ListType.WEST_LIST); westFillerJLabel = new javax.swing.JLabel(); eastListJPanel = new PanelCellListJPanel(eastListModel, ListType.EAST_LIST); eastFillerJLabel = new javax.swing.JLabel(); setLayout(new java.awt.GridBagLayout()); setBorder(BORDER); collapsedJPanel.setLayout(new java.awt.GridBagLayout()); collapsedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { collapsedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { collapsedJPanelMouseReleased(e); } }); iconJLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/IconContainer.png"))); iconJLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent e) { iconJLabelMouseEntered(e); } public void mouseExited(java.awt.event.MouseEvent e) { iconJLabelMouseExited(e); } public void mousePressed(java.awt.event.MouseEvent e) { iconJLabelMousePressed(e); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; gridBagConstraints.insets = new java.awt.Insets(4, 32, 0, 5); collapsedJPanel.add(iconJLabel, gridBagConstraints); textJLabel.setText("!Package Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.insets = new java.awt.Insets(5, 3, 4, 0); collapsedJPanel.add(textJLabel, gridBagConstraints); additionalTextJLabel.setForeground(Colors.Browser.List.INNER_LIST_SELECTION_BORDER); additionalTextJLabel.setText("!Package Additional Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 4, 0); collapsedJPanel.add(additionalTextJLabel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(collapsedJPanel, gridBagConstraints); expandedJPanel.setLayout(new java.awt.GridLayout(1, 0)); expandedJPanel.setOpaque(false); expandedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { expandedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { expandedJPanelMouseReleased(e); } }); westJPanel.setLayout(new java.awt.GridBagLayout()); westJPanel.setOpaque(false); westListJPanel.setLayout(new java.awt.GridBagLayout()); westListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; westJPanel.add(westListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); westJPanel.add(westFillerJLabel, gridBagConstraints); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("localization/ListItem_Messages"); // NOI18N westFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 5); westJPanel.add(westFirstJLabel, gridBagConstraints); westPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westPreviousJLabel, gridBagConstraints); westCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westCountJLabel, gridBagConstraints); westNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westNextJLabel, gridBagConstraints); westLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westLastJLabel, gridBagConstraints); expandedJPanel.add(westJPanel); eastJPanel.setLayout(new java.awt.GridBagLayout()); eastJPanel.setOpaque(false); eastListJPanel.setLayout(new java.awt.GridBagLayout()); eastListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; eastJPanel.add(eastListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); eastJPanel.add(eastFillerJLabel, gridBagConstraints); eastFirstJLabel.setText(java.util.ResourceBundle.getBundle("localization/ListItem_Messages").getString("ContainerPanel.firstJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastFirstJLabel, gridBagConstraints); eastPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastPreviousJLabel, gridBagConstraints); eastCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastCountJLabel, gridBagConstraints); eastNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastNextJLabel, gridBagConstraints); eastLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastLastJLabel, gridBagConstraints); expandedJPanel.add(eastJPanel); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(expandedJPanel, gridBagConstraints); }// </editor-fold>//GEN-END:initComponents
1,114,779
private void initComponents() { javax.swing.JLabel eastFillerJLabel; java.awt.GridBagConstraints gridBagConstraints; javax.swing.JLabel westFillerJLabel; westListJPanel = new PanelCellListJPanel(westListModel, ListType.WEST_LIST); westFillerJLabel = new javax.swing.JLabel(); eastListJPanel = new PanelCellListJPanel(eastListModel, ListType.EAST_LIST); eastFillerJLabel = new javax.swing.JLabel(); setLayout(new java.awt.GridBagLayout()); setBorder(BORDER); collapsedJPanel.setLayout(new java.awt.GridBagLayout()); collapsedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { collapsedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { collapsedJPanelMouseReleased(e); } }); iconJLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/IconContainer.png"))); iconJLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent e) { iconJLabelMouseEntered(e); } public void mouseExited(java.awt.event.MouseEvent e) { iconJLabelMouseExited(e); } public void mousePressed(java.awt.event.MouseEvent e) { iconJLabelMousePressed(e); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; gridBagConstraints.insets = new java.awt.Insets(4, 32, 0, 5); collapsedJPanel.add(iconJLabel, gridBagConstraints); textJLabel.setText("!Package Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.insets = new java.awt.Insets(5, 3, 4, 0); collapsedJPanel.add(textJLabel, gridBagConstraints); additionalTextJLabel.setForeground(Colors.Browser.List.INNER_LIST_SELECTION_BORDER); additionalTextJLabel.setText("!Package Additional Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 4, 0); collapsedJPanel.add(additionalTextJLabel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(collapsedJPanel, gridBagConstraints); expandedJPanel.setLayout(new java.awt.GridLayout(1, 0)); expandedJPanel.setOpaque(false); expandedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { expandedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { expandedJPanelMouseReleased(e); } }); westJPanel.setLayout(new java.awt.GridBagLayout()); westJPanel.setOpaque(false); westListJPanel.setLayout(new java.awt.GridBagLayout()); westListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; westJPanel.add(westListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); westJPanel.add(westFillerJLabel, gridBagConstraints); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("localization/ListItem_Messages"); // NOI18N westFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 5); westJPanel.add(westFirstJLabel, gridBagConstraints); westPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westPreviousJLabel, gridBagConstraints); westCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westCountJLabel, gridBagConstraints); westNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westNextJLabel, gridBagConstraints); westLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westLastJLabel, gridBagConstraints); expandedJPanel.add(westJPanel); eastJPanel.setLayout(new java.awt.GridBagLayout()); eastJPanel.setOpaque(false); eastListJPanel.setLayout(new java.awt.GridBagLayout()); eastListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; eastJPanel.add(eastListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); eastJPanel.add(eastFillerJLabel, gridBagConstraints); eastFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastFirstJLabel, gridBagConstraints); eastPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastPreviousJLabel, gridBagConstraints); eastCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastCountJLabel, gridBagConstraints); eastNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastNextJLabel, gridBagConstraints); eastLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastLastJLabel, gridBagConstraints); expandedJPanel.add(eastJPanel); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(expandedJPanel, gridBagConstraints); }// </editor-fold>//GEN-END:initComponents
private void initComponents() { javax.swing.JLabel eastFillerJLabel; java.awt.GridBagConstraints gridBagConstraints; javax.swing.JLabel westFillerJLabel; westListJPanel = new PanelCellListJPanel(westListModel, ListType.WEST_LIST); westFillerJLabel = new javax.swing.JLabel(); eastListJPanel = new PanelCellListJPanel(eastListModel, ListType.EAST_LIST); eastFillerJLabel = new javax.swing.JLabel(); setLayout(new java.awt.GridBagLayout()); setBorder(BORDER); collapsedJPanel.setLayout(new java.awt.GridBagLayout()); collapsedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { collapsedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { collapsedJPanelMouseReleased(e); } }); iconJLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/IconContainer.png"))); iconJLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent e) { iconJLabelMouseEntered(e); } public void mouseExited(java.awt.event.MouseEvent e) { iconJLabelMouseExited(e); } public void mousePressed(java.awt.event.MouseEvent e) { iconJLabelMousePressed(e); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; gridBagConstraints.insets = new java.awt.Insets(4, 32, 0, 5); collapsedJPanel.add(iconJLabel, gridBagConstraints); textJLabel.setText("!Package Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.insets = new java.awt.Insets(5, 3, 4, 0); collapsedJPanel.add(textJLabel, gridBagConstraints); additionalTextJLabel.setForeground(Colors.Browser.List.INNER_LIST_SELECTION_BORDER); additionalTextJLabel.setText("!Package Additional Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 4, 0); collapsedJPanel.add(additionalTextJLabel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(collapsedJPanel, gridBagConstraints); expandedJPanel.setLayout(new java.awt.GridLayout(1, 0)); expandedJPanel.setOpaque(false); expandedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { expandedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { expandedJPanelMouseReleased(e); } }); westJPanel.setLayout(new java.awt.GridBagLayout()); westJPanel.setOpaque(false); westListJPanel.setLayout(new java.awt.GridBagLayout()); westListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; westJPanel.add(westListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); westJPanel.add(westFillerJLabel, gridBagConstraints); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("localization/ListItem_Messages"); // NOI18N westFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 5); westJPanel.add(westFirstJLabel, gridBagConstraints); westPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westPreviousJLabel, gridBagConstraints); westCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westCountJLabel, gridBagConstraints); westNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westNextJLabel, gridBagConstraints); westLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westLastJLabel, gridBagConstraints); expandedJPanel.add(westJPanel); eastJPanel.setLayout(new java.awt.GridBagLayout()); eastJPanel.setOpaque(false); eastListJPanel.setLayout(new java.awt.GridBagLayout()); eastListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; eastJPanel.add(eastListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); eastJPanel.add(eastFillerJLabel, gridBagConstraints); eastFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastFirstJLabel, gridBagConstraints); eastPreviousJLabel.setText(java.util.ResourceBundle.getBundle("localization/ListItem_Messages").getString("ContainerPanel.previousJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastPreviousJLabel, gridBagConstraints); eastCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastCountJLabel, gridBagConstraints); eastNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastNextJLabel, gridBagConstraints); eastLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastLastJLabel, gridBagConstraints); expandedJPanel.add(eastJPanel); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(expandedJPanel, gridBagConstraints); }// </editor-fold>//GEN-END:initComponents
1,114,780
private void initComponents() { javax.swing.JLabel eastFillerJLabel; java.awt.GridBagConstraints gridBagConstraints; javax.swing.JLabel westFillerJLabel; westListJPanel = new PanelCellListJPanel(westListModel, ListType.WEST_LIST); westFillerJLabel = new javax.swing.JLabel(); eastListJPanel = new PanelCellListJPanel(eastListModel, ListType.EAST_LIST); eastFillerJLabel = new javax.swing.JLabel(); setLayout(new java.awt.GridBagLayout()); setBorder(BORDER); collapsedJPanel.setLayout(new java.awt.GridBagLayout()); collapsedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { collapsedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { collapsedJPanelMouseReleased(e); } }); iconJLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/IconContainer.png"))); iconJLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent e) { iconJLabelMouseEntered(e); } public void mouseExited(java.awt.event.MouseEvent e) { iconJLabelMouseExited(e); } public void mousePressed(java.awt.event.MouseEvent e) { iconJLabelMousePressed(e); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; gridBagConstraints.insets = new java.awt.Insets(4, 32, 0, 5); collapsedJPanel.add(iconJLabel, gridBagConstraints); textJLabel.setText("!Package Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.insets = new java.awt.Insets(5, 3, 4, 0); collapsedJPanel.add(textJLabel, gridBagConstraints); additionalTextJLabel.setForeground(Colors.Browser.List.INNER_LIST_SELECTION_BORDER); additionalTextJLabel.setText("!Package Additional Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 4, 0); collapsedJPanel.add(additionalTextJLabel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(collapsedJPanel, gridBagConstraints); expandedJPanel.setLayout(new java.awt.GridLayout(1, 0)); expandedJPanel.setOpaque(false); expandedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { expandedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { expandedJPanelMouseReleased(e); } }); westJPanel.setLayout(new java.awt.GridBagLayout()); westJPanel.setOpaque(false); westListJPanel.setLayout(new java.awt.GridBagLayout()); westListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; westJPanel.add(westListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); westJPanel.add(westFillerJLabel, gridBagConstraints); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("localization/ListItem_Messages"); // NOI18N westFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 5); westJPanel.add(westFirstJLabel, gridBagConstraints); westPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westPreviousJLabel, gridBagConstraints); westCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westCountJLabel, gridBagConstraints); westNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westNextJLabel, gridBagConstraints); westLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westLastJLabel, gridBagConstraints); expandedJPanel.add(westJPanel); eastJPanel.setLayout(new java.awt.GridBagLayout()); eastJPanel.setOpaque(false); eastListJPanel.setLayout(new java.awt.GridBagLayout()); eastListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; eastJPanel.add(eastListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); eastJPanel.add(eastFillerJLabel, gridBagConstraints); eastFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastFirstJLabel, gridBagConstraints); eastPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastPreviousJLabel, gridBagConstraints); eastCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastCountJLabel, gridBagConstraints); eastNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastNextJLabel, gridBagConstraints); eastLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastLastJLabel, gridBagConstraints); expandedJPanel.add(eastJPanel); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(expandedJPanel, gridBagConstraints); }// </editor-fold>//GEN-END:initComponents
private void initComponents() { javax.swing.JLabel eastFillerJLabel; java.awt.GridBagConstraints gridBagConstraints; javax.swing.JLabel westFillerJLabel; westListJPanel = new PanelCellListJPanel(westListModel, ListType.WEST_LIST); westFillerJLabel = new javax.swing.JLabel(); eastListJPanel = new PanelCellListJPanel(eastListModel, ListType.EAST_LIST); eastFillerJLabel = new javax.swing.JLabel(); setLayout(new java.awt.GridBagLayout()); setBorder(BORDER); collapsedJPanel.setLayout(new java.awt.GridBagLayout()); collapsedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { collapsedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { collapsedJPanelMouseReleased(e); } }); iconJLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/IconContainer.png"))); iconJLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent e) { iconJLabelMouseEntered(e); } public void mouseExited(java.awt.event.MouseEvent e) { iconJLabelMouseExited(e); } public void mousePressed(java.awt.event.MouseEvent e) { iconJLabelMousePressed(e); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; gridBagConstraints.insets = new java.awt.Insets(4, 32, 0, 5); collapsedJPanel.add(iconJLabel, gridBagConstraints); textJLabel.setText("!Package Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.insets = new java.awt.Insets(5, 3, 4, 0); collapsedJPanel.add(textJLabel, gridBagConstraints); additionalTextJLabel.setForeground(Colors.Browser.List.INNER_LIST_SELECTION_BORDER); additionalTextJLabel.setText("!Package Additional Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 4, 0); collapsedJPanel.add(additionalTextJLabel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(collapsedJPanel, gridBagConstraints); expandedJPanel.setLayout(new java.awt.GridLayout(1, 0)); expandedJPanel.setOpaque(false); expandedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { expandedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { expandedJPanelMouseReleased(e); } }); westJPanel.setLayout(new java.awt.GridBagLayout()); westJPanel.setOpaque(false); westListJPanel.setLayout(new java.awt.GridBagLayout()); westListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; westJPanel.add(westListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); westJPanel.add(westFillerJLabel, gridBagConstraints); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("localization/ListItem_Messages"); // NOI18N westFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 5); westJPanel.add(westFirstJLabel, gridBagConstraints); westPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westPreviousJLabel, gridBagConstraints); westCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westCountJLabel, gridBagConstraints); westNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westNextJLabel, gridBagConstraints); westLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westLastJLabel, gridBagConstraints); expandedJPanel.add(westJPanel); eastJPanel.setLayout(new java.awt.GridBagLayout()); eastJPanel.setOpaque(false); eastListJPanel.setLayout(new java.awt.GridBagLayout()); eastListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; eastJPanel.add(eastListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); eastJPanel.add(eastFillerJLabel, gridBagConstraints); eastFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastFirstJLabel, gridBagConstraints); eastPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastPreviousJLabel, gridBagConstraints); eastCountJLabel.setText(java.util.ResourceBundle.getBundle("localization/ListItem_Messages").getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastCountJLabel, gridBagConstraints); eastNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastNextJLabel, gridBagConstraints); eastLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastLastJLabel, gridBagConstraints); expandedJPanel.add(eastJPanel); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(expandedJPanel, gridBagConstraints); }// </editor-fold>//GEN-END:initComponents
1,114,781
private void initComponents() { javax.swing.JLabel eastFillerJLabel; java.awt.GridBagConstraints gridBagConstraints; javax.swing.JLabel westFillerJLabel; westListJPanel = new PanelCellListJPanel(westListModel, ListType.WEST_LIST); westFillerJLabel = new javax.swing.JLabel(); eastListJPanel = new PanelCellListJPanel(eastListModel, ListType.EAST_LIST); eastFillerJLabel = new javax.swing.JLabel(); setLayout(new java.awt.GridBagLayout()); setBorder(BORDER); collapsedJPanel.setLayout(new java.awt.GridBagLayout()); collapsedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { collapsedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { collapsedJPanelMouseReleased(e); } }); iconJLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/IconContainer.png"))); iconJLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent e) { iconJLabelMouseEntered(e); } public void mouseExited(java.awt.event.MouseEvent e) { iconJLabelMouseExited(e); } public void mousePressed(java.awt.event.MouseEvent e) { iconJLabelMousePressed(e); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; gridBagConstraints.insets = new java.awt.Insets(4, 32, 0, 5); collapsedJPanel.add(iconJLabel, gridBagConstraints); textJLabel.setText("!Package Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.insets = new java.awt.Insets(5, 3, 4, 0); collapsedJPanel.add(textJLabel, gridBagConstraints); additionalTextJLabel.setForeground(Colors.Browser.List.INNER_LIST_SELECTION_BORDER); additionalTextJLabel.setText("!Package Additional Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 4, 0); collapsedJPanel.add(additionalTextJLabel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(collapsedJPanel, gridBagConstraints); expandedJPanel.setLayout(new java.awt.GridLayout(1, 0)); expandedJPanel.setOpaque(false); expandedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { expandedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { expandedJPanelMouseReleased(e); } }); westJPanel.setLayout(new java.awt.GridBagLayout()); westJPanel.setOpaque(false); westListJPanel.setLayout(new java.awt.GridBagLayout()); westListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; westJPanel.add(westListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); westJPanel.add(westFillerJLabel, gridBagConstraints); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("localization/ListItem_Messages"); // NOI18N westFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 5); westJPanel.add(westFirstJLabel, gridBagConstraints); westPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westPreviousJLabel, gridBagConstraints); westCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westCountJLabel, gridBagConstraints); westNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westNextJLabel, gridBagConstraints); westLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westLastJLabel, gridBagConstraints); expandedJPanel.add(westJPanel); eastJPanel.setLayout(new java.awt.GridBagLayout()); eastJPanel.setOpaque(false); eastListJPanel.setLayout(new java.awt.GridBagLayout()); eastListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; eastJPanel.add(eastListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); eastJPanel.add(eastFillerJLabel, gridBagConstraints); eastFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastFirstJLabel, gridBagConstraints); eastPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastPreviousJLabel, gridBagConstraints); eastCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastCountJLabel, gridBagConstraints); eastNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastNextJLabel, gridBagConstraints); eastLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastLastJLabel, gridBagConstraints); expandedJPanel.add(eastJPanel); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(expandedJPanel, gridBagConstraints); }// </editor-fold>//GEN-END:initComponents
private void initComponents() { javax.swing.JLabel eastFillerJLabel; java.awt.GridBagConstraints gridBagConstraints; javax.swing.JLabel westFillerJLabel; westListJPanel = new PanelCellListJPanel(westListModel, ListType.WEST_LIST); westFillerJLabel = new javax.swing.JLabel(); eastListJPanel = new PanelCellListJPanel(eastListModel, ListType.EAST_LIST); eastFillerJLabel = new javax.swing.JLabel(); setLayout(new java.awt.GridBagLayout()); setBorder(BORDER); collapsedJPanel.setLayout(new java.awt.GridBagLayout()); collapsedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { collapsedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { collapsedJPanelMouseReleased(e); } }); iconJLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/IconContainer.png"))); iconJLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent e) { iconJLabelMouseEntered(e); } public void mouseExited(java.awt.event.MouseEvent e) { iconJLabelMouseExited(e); } public void mousePressed(java.awt.event.MouseEvent e) { iconJLabelMousePressed(e); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; gridBagConstraints.insets = new java.awt.Insets(4, 32, 0, 5); collapsedJPanel.add(iconJLabel, gridBagConstraints); textJLabel.setText("!Package Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.insets = new java.awt.Insets(5, 3, 4, 0); collapsedJPanel.add(textJLabel, gridBagConstraints); additionalTextJLabel.setForeground(Colors.Browser.List.INNER_LIST_SELECTION_BORDER); additionalTextJLabel.setText("!Package Additional Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 4, 0); collapsedJPanel.add(additionalTextJLabel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(collapsedJPanel, gridBagConstraints); expandedJPanel.setLayout(new java.awt.GridLayout(1, 0)); expandedJPanel.setOpaque(false); expandedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { expandedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { expandedJPanelMouseReleased(e); } }); westJPanel.setLayout(new java.awt.GridBagLayout()); westJPanel.setOpaque(false); westListJPanel.setLayout(new java.awt.GridBagLayout()); westListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; westJPanel.add(westListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); westJPanel.add(westFillerJLabel, gridBagConstraints); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("localization/ListItem_Messages"); // NOI18N westFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 5); westJPanel.add(westFirstJLabel, gridBagConstraints); westPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westPreviousJLabel, gridBagConstraints); westCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westCountJLabel, gridBagConstraints); westNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westNextJLabel, gridBagConstraints); westLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westLastJLabel, gridBagConstraints); expandedJPanel.add(westJPanel); eastJPanel.setLayout(new java.awt.GridBagLayout()); eastJPanel.setOpaque(false); eastListJPanel.setLayout(new java.awt.GridBagLayout()); eastListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; eastJPanel.add(eastListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); eastJPanel.add(eastFillerJLabel, gridBagConstraints); eastFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastFirstJLabel, gridBagConstraints); eastPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastPreviousJLabel, gridBagConstraints); eastCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastCountJLabel, gridBagConstraints); eastNextJLabel.setText(java.util.ResourceBundle.getBundle("localization/ListItem_Messages").getString("ContainerPanel.nextJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastNextJLabel, gridBagConstraints); eastLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastLastJLabel, gridBagConstraints); expandedJPanel.add(eastJPanel); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(expandedJPanel, gridBagConstraints); }// </editor-fold>//GEN-END:initComponents
1,114,782
private void initComponents() { javax.swing.JLabel eastFillerJLabel; java.awt.GridBagConstraints gridBagConstraints; javax.swing.JLabel westFillerJLabel; westListJPanel = new PanelCellListJPanel(westListModel, ListType.WEST_LIST); westFillerJLabel = new javax.swing.JLabel(); eastListJPanel = new PanelCellListJPanel(eastListModel, ListType.EAST_LIST); eastFillerJLabel = new javax.swing.JLabel(); setLayout(new java.awt.GridBagLayout()); setBorder(BORDER); collapsedJPanel.setLayout(new java.awt.GridBagLayout()); collapsedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { collapsedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { collapsedJPanelMouseReleased(e); } }); iconJLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/IconContainer.png"))); iconJLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent e) { iconJLabelMouseEntered(e); } public void mouseExited(java.awt.event.MouseEvent e) { iconJLabelMouseExited(e); } public void mousePressed(java.awt.event.MouseEvent e) { iconJLabelMousePressed(e); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; gridBagConstraints.insets = new java.awt.Insets(4, 32, 0, 5); collapsedJPanel.add(iconJLabel, gridBagConstraints); textJLabel.setText("!Package Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.insets = new java.awt.Insets(5, 3, 4, 0); collapsedJPanel.add(textJLabel, gridBagConstraints); additionalTextJLabel.setForeground(Colors.Browser.List.INNER_LIST_SELECTION_BORDER); additionalTextJLabel.setText("!Package Additional Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 4, 0); collapsedJPanel.add(additionalTextJLabel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(collapsedJPanel, gridBagConstraints); expandedJPanel.setLayout(new java.awt.GridLayout(1, 0)); expandedJPanel.setOpaque(false); expandedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { expandedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { expandedJPanelMouseReleased(e); } }); westJPanel.setLayout(new java.awt.GridBagLayout()); westJPanel.setOpaque(false); westListJPanel.setLayout(new java.awt.GridBagLayout()); westListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; westJPanel.add(westListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); westJPanel.add(westFillerJLabel, gridBagConstraints); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("localization/ListItem_Messages"); // NOI18N westFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 5); westJPanel.add(westFirstJLabel, gridBagConstraints); westPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westPreviousJLabel, gridBagConstraints); westCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westCountJLabel, gridBagConstraints); westNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westNextJLabel, gridBagConstraints); westLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westLastJLabel, gridBagConstraints); expandedJPanel.add(westJPanel); eastJPanel.setLayout(new java.awt.GridBagLayout()); eastJPanel.setOpaque(false); eastListJPanel.setLayout(new java.awt.GridBagLayout()); eastListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; eastJPanel.add(eastListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); eastJPanel.add(eastFillerJLabel, gridBagConstraints); eastFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastFirstJLabel, gridBagConstraints); eastPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastPreviousJLabel, gridBagConstraints); eastCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastCountJLabel, gridBagConstraints); eastNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastNextJLabel, gridBagConstraints); eastLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastLastJLabel, gridBagConstraints); expandedJPanel.add(eastJPanel); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(expandedJPanel, gridBagConstraints); }// </editor-fold>//GEN-END:initComponents
private void initComponents() { javax.swing.JLabel eastFillerJLabel; java.awt.GridBagConstraints gridBagConstraints; javax.swing.JLabel westFillerJLabel; westListJPanel = new PanelCellListJPanel(westListModel, ListType.WEST_LIST); westFillerJLabel = new javax.swing.JLabel(); eastListJPanel = new PanelCellListJPanel(eastListModel, ListType.EAST_LIST); eastFillerJLabel = new javax.swing.JLabel(); setLayout(new java.awt.GridBagLayout()); setBorder(BORDER); collapsedJPanel.setLayout(new java.awt.GridBagLayout()); collapsedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { collapsedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { collapsedJPanelMouseReleased(e); } }); iconJLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/IconContainer.png"))); iconJLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent e) { iconJLabelMouseEntered(e); } public void mouseExited(java.awt.event.MouseEvent e) { iconJLabelMouseExited(e); } public void mousePressed(java.awt.event.MouseEvent e) { iconJLabelMousePressed(e); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH; gridBagConstraints.insets = new java.awt.Insets(4, 32, 0, 5); collapsedJPanel.add(iconJLabel, gridBagConstraints); textJLabel.setText("!Package Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.insets = new java.awt.Insets(5, 3, 4, 0); collapsedJPanel.add(textJLabel, gridBagConstraints); additionalTextJLabel.setForeground(Colors.Browser.List.INNER_LIST_SELECTION_BORDER); additionalTextJLabel.setText("!Package Additional Text!"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 4, 0); collapsedJPanel.add(additionalTextJLabel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(collapsedJPanel, gridBagConstraints); expandedJPanel.setLayout(new java.awt.GridLayout(1, 0)); expandedJPanel.setOpaque(false); expandedJPanel.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent e) { expandedJPanelMousePressed(e); } public void mouseReleased(java.awt.event.MouseEvent e) { expandedJPanelMouseReleased(e); } }); westJPanel.setLayout(new java.awt.GridBagLayout()); westJPanel.setOpaque(false); westListJPanel.setLayout(new java.awt.GridBagLayout()); westListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; westJPanel.add(westListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); westJPanel.add(westFillerJLabel, gridBagConstraints); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("localization/ListItem_Messages"); // NOI18N westFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 5); westJPanel.add(westFirstJLabel, gridBagConstraints); westPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westPreviousJLabel, gridBagConstraints); westCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westCountJLabel, gridBagConstraints); westNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westNextJLabel, gridBagConstraints); westLastJLabel.setText(bundle.getString("ContainerPanel.lastJLabelWest")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); westJPanel.add(westLastJLabel, gridBagConstraints); expandedJPanel.add(westJPanel); eastJPanel.setLayout(new java.awt.GridBagLayout()); eastJPanel.setOpaque(false); eastListJPanel.setLayout(new java.awt.GridBagLayout()); eastListJPanel.setOpaque(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; eastJPanel.add(eastListJPanel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0); eastJPanel.add(eastFillerJLabel, gridBagConstraints); eastFirstJLabel.setText(bundle.getString("ContainerPanel.firstJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastFirstJLabel, gridBagConstraints); eastPreviousJLabel.setText(bundle.getString("ContainerPanel.previousJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastPreviousJLabel, gridBagConstraints); eastCountJLabel.setText(bundle.getString("ContainerPanel.countJLabel")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastCountJLabel, gridBagConstraints); eastNextJLabel.setText(bundle.getString("ContainerPanel.nextJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 4; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastNextJLabel, gridBagConstraints); eastLastJLabel.setText(java.util.ResourceBundle.getBundle("localization/ListItem_Messages").getString("ContainerPanel.lastJLabelEast")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 5; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 5, 1, 5); eastJPanel.add(eastLastJLabel, gridBagConstraints); expandedJPanel.add(eastJPanel); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; add(expandedJPanel, gridBagConstraints); }// </editor-fold>//GEN-END:initComponents
1,114,783
public void mousePressed(java.awt.event.MouseEvent e) { collapsedJPanelMousePressed(e); }
public void mousePressed(java.awt.event.MouseEvent e) { collapsedJPanelMousePressed(e); }
1,114,784
public void mouseReleased(java.awt.event.MouseEvent e) { collapsedJPanelMouseReleased(e); }
public void mouseReleased(java.awt.event.MouseEvent e) { collapsedJPanelMouseReleased(e); }
1,114,785
public void mouseEntered(java.awt.event.MouseEvent e) { iconJLabelMouseEntered(e); }
public void mouseEntered(java.awt.event.MouseEvent e) { iconJLabelMouseEntered(e); }
1,114,786
public void mouseExited(java.awt.event.MouseEvent e) { iconJLabelMouseExited(e); }
public void mouseExited(java.awt.event.MouseEvent e) { iconJLabelMouseExited(e); }
1,114,787
public void mousePressed(java.awt.event.MouseEvent e) { iconJLabelMousePressed(e); }
public void mousePressed(java.awt.event.MouseEvent e) { iconJLabelMousePressed(e); }
1,114,788
public void mousePressed(java.awt.event.MouseEvent e) { expandedJPanelMousePressed(e); }
public void mousePressed(java.awt.event.MouseEvent e) { expandedJPanelMousePressed(e); }
1,114,789
public void mouseReleased(java.awt.event.MouseEvent e) { expandedJPanelMouseReleased(e); }
public void mouseReleased(java.awt.event.MouseEvent e) { expandedJPanelMouseReleased(e); }
1,114,790
public void panelCellMousePressed(final Cell cell, final MouseEvent e) { if (cell instanceof WestCell) { westListModel.setSelectedCell(cell); } if ((e.getClickCount() % 2) == 0) { tabDelegate.toggleExpansion(this); } }
public void panelCellMousePressed(final Cell cell, final Boolean onIcon, final MouseEvent e) { if (cell instanceof WestCell) { westListModel.setSelectedCell(cell); } if ((e.getClickCount() % 2) == 0) { tabDelegate.toggleExpansion(this); } }
1,114,791