You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(97) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(127) |
Feb
(34) |
Mar
(16) |
Apr
(26) |
May
(55) |
Jun
(107) |
Jul
(36) |
Aug
(72) |
Sep
(90) |
Oct
(41) |
Nov
(27) |
Dec
(13) |
2008 |
Jan
(37) |
Feb
(39) |
Mar
(98) |
Apr
(115) |
May
(134) |
Jun
(120) |
Jul
(86) |
Aug
(149) |
Sep
(68) |
Oct
(66) |
Nov
(104) |
Dec
(49) |
2009 |
Jan
(131) |
Feb
(132) |
Mar
(125) |
Apr
(172) |
May
(161) |
Jun
(43) |
Jul
(47) |
Aug
(38) |
Sep
(18) |
Oct
(6) |
Nov
(1) |
Dec
(15) |
2010 |
Jan
(21) |
Feb
(8) |
Mar
(10) |
Apr
(4) |
May
(9) |
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
(4) |
2011 |
Jan
(23) |
Feb
(10) |
Mar
(13) |
Apr
(3) |
May
|
Jun
(19) |
Jul
(11) |
Aug
(22) |
Sep
|
Oct
(4) |
Nov
(2) |
Dec
(12) |
2012 |
Jan
(3) |
Feb
(4) |
Mar
(7) |
Apr
(3) |
May
|
Jun
(1) |
Jul
(1) |
Aug
(30) |
Sep
(3) |
Oct
(2) |
Nov
|
Dec
(8) |
2013 |
Jan
(3) |
Feb
(40) |
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(12) |
Dec
|
2021 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
From: <ls...@us...> - 2011-08-17 19:41:34
|
Revision: 5851 http://jnode.svn.sourceforge.net/jnode/?rev=5851&view=rev Author: lsantha Date: 2011-08-17 19:41:28 +0000 (Wed, 17 Aug 2011) Log Message: ----------- Added shell command: cmp. Modified Paths: -------------- trunk/cli/descriptors/org.jnode.command.file.xml Added Paths: ----------- trunk/cli/src/commands/org/jnode/command/file/CmpCommand.java Modified: trunk/cli/descriptors/org.jnode.command.file.xml =================================================================== --- trunk/cli/descriptors/org.jnode.command.file.xml 2011-08-16 21:16:00 UTC (rev 5850) +++ trunk/cli/descriptors/org.jnode.command.file.xml 2011-08-17 19:41:28 UTC (rev 5851) @@ -26,6 +26,7 @@ <extension point="org.jnode.shell.aliases"> <alias name="cat" class="org.jnode.command.file.CatCommand"/> <alias name="cd" class="org.jnode.command.file.CdCommand" internal="yes"/> + <alias name="cmp" class="org.jnode.command.file.CmpCommand"/> <alias name="cp" class="org.jnode.command.file.CpCommand"/> <alias name="cut" class="org.jnode.command.file.CutCommand"/> <alias name="del" class="org.jnode.command.file.DeleteCommand"/> @@ -74,6 +75,12 @@ <empty description="change the current directory to the 'user.home' directory"/> <argument argLabel="directory" description="change the current directory to 'directory'"/> </syntax> + <syntax alias="cmp"> + <sequence description="compare two files"> + <argument argLabel="file1"/> + <argument argLabel="file2"/> + </sequence> + </syntax> <syntax alias="cp"> <sequence description="copy files or directories"> <optionSet> Added: trunk/cli/src/commands/org/jnode/command/file/CmpCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/file/CmpCommand.java (rev 0) +++ trunk/cli/src/commands/org/jnode/command/file/CmpCommand.java 2011-08-17 19:41:28 UTC (rev 5851) @@ -0,0 +1,123 @@ +package org.jnode.command.file; + +import java.io.BufferedInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.PrintWriter; +import org.jnode.shell.AbstractCommand; +import org.jnode.shell.syntax.Argument; +import org.jnode.shell.syntax.FileArgument; + +/** + * Compare two files and report the first difference. + * + * @author Levente S\u00e1ntha + */ +public class CmpCommand extends AbstractCommand { + + private static final int BUFFER_SIZE = 64 * 1024; + + private static final String HELP_SUPER = "Compare two files"; + private static final String HELP_FILE = "a file to compare"; + private static final String ERR_FILE_INVALID = "%s is not a file%n"; + private static final String MSG_DIFFER = "%s %s differ: byte %d, line %d%n"; + private static final String MSG_EOF = "cmp: EOF on %s%n"; + + private final FileArgument file1Arg; + private final FileArgument file2Arg; + + public CmpCommand() { + super(HELP_SUPER); + + file1Arg = new FileArgument("file1", Argument.MANDATORY | Argument.EXISTING, HELP_FILE); + file2Arg = new FileArgument("file2", Argument.MANDATORY | Argument.EXISTING, HELP_FILE); + + registerArguments(file1Arg, file2Arg); + } + + public static void main(String[] args) throws Exception { + new CmpCommand().execute(args); + } + + @Override + public void execute() throws IOException { + + File file1 = file1Arg.getValue(); + File file2 = file2Arg.getValue(); + + PrintWriter err = getError().getPrintWriter(); + + if (!file1.isFile()) { + err.format(ERR_FILE_INVALID, file1); + exit(1); + } + + if (!file2.isFile()) { + err.format(ERR_FILE_INVALID, file2); + exit(1); + } + + BufferedInputStream bis1 = null; + BufferedInputStream bis2 = null; + + try { + bis1 = new BufferedInputStream(new FileInputStream(file1), BUFFER_SIZE); + bis2 = new BufferedInputStream(new FileInputStream(file2), BUFFER_SIZE); + + long bc = 1; + long lc = 1; + + while (true) { + int b1 = bis1.read(); + int b2 = bis2.read(); + + if (b1 == -1 && b2 == -1) + //done + break; + + if (b1 == -1) { + PrintWriter out = getOutput().getPrintWriter(); + out.format(MSG_EOF, file1.toString()); + exit(1); + return; + } + + if (b2 == -1) { + PrintWriter out = getOutput().getPrintWriter(); + out.format(MSG_EOF, file2.toString()); + exit(1); + return; + } + + if (b1 != b2) { + PrintWriter out = getOutput().getPrintWriter(); + out.format(MSG_DIFFER, file1.toString(), file2.toString(), bc, lc); + exit(1); + return; + } + + bc++; + + if (b1 == (byte) '\n') + lc++; + } + } finally { + if (bis1 != null) { + try { + bis1.close(); + } catch (IOException x) { + //ignore + } + } + + if (bis2 != null) { + try { + bis2.close(); + } catch (IOException x) { + //ignore + } + } + } + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2011-08-16 21:24:03
|
Revision: 5846 http://jnode.svn.sourceforge.net/jnode/?rev=5846&view=rev Author: lsantha Date: 2011-08-16 20:19:43 +0000 (Tue, 16 Aug 2011) Log Message: ----------- Increased timeout for IDE device detection. Modified Paths: -------------- trunk/fs/src/driver/org/jnode/driver/bus/ide/IDEBus.java Modified: trunk/fs/src/driver/org/jnode/driver/bus/ide/IDEBus.java =================================================================== --- trunk/fs/src/driver/org/jnode/driver/bus/ide/IDEBus.java 2011-08-11 11:42:10 UTC (rev 5845) +++ trunk/fs/src/driver/org/jnode/driver/bus/ide/IDEBus.java 2011-08-16 20:19:43 UTC (rev 5846) @@ -278,7 +278,7 @@ | (master ? SEL_DRIVE_MASTER : SEL_DRIVE_SLAVE); io.setSelectReg(select); // Wait a while - TimeUtils.sleep(50); + TimeUtils.sleep(200); return (io.getSelectReg() == select); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2011-08-16 21:24:00
|
Revision: 5848 http://jnode.svn.sourceforge.net/jnode/?rev=5848&view=rev Author: lsantha Date: 2011-08-16 20:49:41 +0000 (Tue, 16 Aug 2011) Log Message: ----------- Fixed API registration bug in IDEDiskDriver. Modified Paths: -------------- trunk/fs/src/driver/org/jnode/driver/block/ide/disk/IDEDiskDriver.java Added Paths: ----------- trunk/fs/src/driver/org/jnode/driver/block/ide/disk/IDEDeviceBlockAlignmentSupport.java Added: trunk/fs/src/driver/org/jnode/driver/block/ide/disk/IDEDeviceBlockAlignmentSupport.java =================================================================== --- trunk/fs/src/driver/org/jnode/driver/block/ide/disk/IDEDeviceBlockAlignmentSupport.java (rev 0) +++ trunk/fs/src/driver/org/jnode/driver/block/ide/disk/IDEDeviceBlockAlignmentSupport.java 2011-08-16 20:49:41 UTC (rev 5848) @@ -0,0 +1,17 @@ +package org.jnode.driver.block.ide.disk; + +import org.jnode.driver.block.PartitionableBlockAlignmentSupport; +import org.jnode.driver.bus.ide.IDEDeviceAPI; +import org.jnode.partitions.PartitionTableEntry; + +/** + * @author Levente S\u00e1ntha + */ +public class IDEDeviceBlockAlignmentSupport<PTE extends PartitionTableEntry> + extends PartitionableBlockAlignmentSupport<PTE> + implements IDEDeviceAPI<PTE> { + + public IDEDeviceBlockAlignmentSupport(IDEDeviceAPI<PTE> parentApi, int alignment) { + super(parentApi, alignment); + } +} Modified: trunk/fs/src/driver/org/jnode/driver/block/ide/disk/IDEDiskDriver.java =================================================================== --- trunk/fs/src/driver/org/jnode/driver/block/ide/disk/IDEDiskDriver.java 2011-08-16 20:43:33 UTC (rev 5847) +++ trunk/fs/src/driver/org/jnode/driver/block/ide/disk/IDEDiskDriver.java 2011-08-16 20:49:41 UTC (rev 5848) @@ -92,8 +92,9 @@ final IDEDevice dev = (IDEDevice) getDevice(); diskBus = new IDEDiskBus(dev); /* Register the IDEDevice API */ - // FIXME - something is wrong with the typing here I think. - dev.registerAPI(PartitionableBlockDeviceAPI.class, new PartitionableBlockAlignmentSupport(this, SECTOR_SIZE)); + dev.registerAPI(IDEDeviceAPI.class, + new IDEDeviceBlockAlignmentSupport<IBMPartitionTableEntry>(this, SECTOR_SIZE)); + /* Get basic configuration */ final IDEDriveDescriptor descr = dev.getDescriptor(); //lba = descr.supportsLBA(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2011-08-16 21:16:07
|
Revision: 5850 http://jnode.svn.sourceforge.net/jnode/?rev=5850&view=rev Author: lsantha Date: 2011-08-16 21:16:00 +0000 (Tue, 16 Aug 2011) Log Message: ----------- Checkstyle fixes. Modified Paths: -------------- trunk/cli/src/commands/org/jnode/command/system/ThreadCommand.java trunk/fs/src/driver/org/jnode/driver/block/ide/disk/IDEDiskDriver.java trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusDirectory.java trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusEntry.java trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusFile.java Modified: trunk/cli/src/commands/org/jnode/command/system/ThreadCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/system/ThreadCommand.java 2011-08-16 20:52:13 UTC (rev 5849) +++ trunk/cli/src/commands/org/jnode/command/system/ThreadCommand.java 2011-08-16 21:16:00 UTC (rev 5850) @@ -88,7 +88,7 @@ // standard API. grp.list(); } else { - if(!argVerbose.isSet() && !argName.isSet()) { + if (!argVerbose.isSet() && !argName.isSet()) { showDefaultInfo(grp); } else { // Show the threads in the ThreadGroup tree. @@ -107,7 +107,7 @@ findThreads(grp, threadSet); PrintWriter out = getOutput().getPrintWriter(); - for(final Thread thread : threadSet) { + for (final Thread thread : threadSet) { VmThread vmThread = AccessController.doPrivileged(new PrivilegedAction<VmThread>() { public VmThread run() { return ThreadHelper.getVmThread(thread); Modified: trunk/fs/src/driver/org/jnode/driver/block/ide/disk/IDEDiskDriver.java =================================================================== --- trunk/fs/src/driver/org/jnode/driver/block/ide/disk/IDEDiskDriver.java 2011-08-16 20:52:13 UTC (rev 5849) +++ trunk/fs/src/driver/org/jnode/driver/block/ide/disk/IDEDiskDriver.java 2011-08-16 21:16:00 UTC (rev 5850) @@ -40,8 +40,6 @@ import org.jnode.driver.DriverException; import org.jnode.driver.block.BlockDeviceAPI; import org.jnode.driver.block.BlockDeviceAPIHelper; -import org.jnode.driver.block.PartitionableBlockAlignmentSupport; -import org.jnode.driver.block.PartitionableBlockDeviceAPI; import org.jnode.driver.bus.ide.IDEBus; import org.jnode.driver.bus.ide.IDEConstants; import org.jnode.driver.bus.ide.IDEDevice; Modified: trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusDirectory.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusDirectory.java 2011-08-16 20:52:13 UTC (rev 5849) +++ trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusDirectory.java 2011-08-16 21:16:00 UTC (rev 5850) @@ -229,7 +229,7 @@ if (getFileSystem().isReadOnly()) { throw new ReadOnlyFileSystemException(); } - Catalog catalog = ((HfsPlusFileSystem)getFileSystem()).getCatalog(); + Catalog catalog = ((HfsPlusFileSystem) getFileSystem()).getCatalog(); SuperBlock volumeHeader = ((HfsPlusFileSystem) getFileSystem()).getVolumeHeader(); LeafRecord folderRecord = catalog.createNode(name, this.folder.getFolderId(), @@ -237,7 +237,7 @@ CatalogFolder.RECORD_TYPE_FOLDER_THREAD); folder.setValence(folder.getValence() + 1); - HfsPlusEntry newEntry = new HfsPlusEntry((HfsPlusFileSystem)getFileSystem(), this, name, folderRecord); + HfsPlusEntry newEntry = new HfsPlusEntry((HfsPlusFileSystem) getFileSystem(), this, name, folderRecord); newEntry.setDirty(); volumeHeader.setFolderCount(volumeHeader.getFolderCount() + 1); log.debug("New volume header :\n" + volumeHeader.toString()); Modified: trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusEntry.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusEntry.java 2011-08-16 20:52:13 UTC (rev 5849) +++ trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusEntry.java 2011-08-16 21:16:00 UTC (rev 5850) @@ -26,7 +26,6 @@ import org.jnode.fs.FSDirectory; import org.jnode.fs.FSEntry; import org.jnode.fs.FSFile; -import org.jnode.fs.FSObject; import org.jnode.fs.FileSystem; import org.jnode.fs.hfsplus.catalog.CatalogFile; import org.jnode.fs.hfsplus.catalog.CatalogFolder; @@ -165,7 +164,7 @@ return valid; } - public byte[] getData(){ + public byte[] getData() { return this.record.getData(); } Modified: trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusFile.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusFile.java 2011-08-16 20:52:13 UTC (rev 5849) +++ trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusFile.java 2011-08-16 21:16:00 UTC (rev 5850) @@ -27,7 +27,6 @@ import org.jnode.fs.FileSystem; import org.jnode.fs.hfsplus.catalog.CatalogFile; import org.jnode.fs.hfsplus.extent.ExtentDescriptor; -import org.jnode.fs.hfsplus.tree.LeafRecord; public class HfsPlusFile implements FSFile { @@ -74,7 +73,7 @@ @Override public boolean isValid() { - return entry.isValid(); + return entry.isValid(); } @Override This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2011-08-16 20:52:19
|
Revision: 5849 http://jnode.svn.sourceforge.net/jnode/?rev=5849&view=rev Author: lsantha Date: 2011-08-16 20:52:13 +0000 (Tue, 16 Aug 2011) Log Message: ----------- Improvements 'fdisk' command to output and device parameter. Modified Paths: -------------- trunk/fs/src/fs/org/jnode/partitions/command/FdiskCommand.java Modified: trunk/fs/src/fs/org/jnode/partitions/command/FdiskCommand.java =================================================================== --- trunk/fs/src/fs/org/jnode/partitions/command/FdiskCommand.java 2011-08-16 20:49:41 UTC (rev 5848) +++ trunk/fs/src/fs/org/jnode/partitions/command/FdiskCommand.java 2011-08-16 20:52:13 UTC (rev 5849) @@ -32,6 +32,7 @@ import org.jnode.driver.block.BlockDeviceAPI; import org.jnode.driver.bus.ide.IDEConstants; import org.jnode.driver.bus.ide.IDEDevice; +import org.jnode.driver.bus.ide.IDEDeviceAPI; import org.jnode.driver.bus.ide.IDEDriveDescriptor; import org.jnode.naming.InitialNaming; import org.jnode.partitions.ibm.IBMPartitionTable; @@ -83,8 +84,9 @@ private final IBMPartitionTypeArgument ARG_TYPE = new IBMPartitionTypeArgument("type", Argument.OPTIONAL, "IBM partition type code"); + //todo add support for more BlockDeviceAPI types private final DeviceArgument ARG_DEVICE = - new DeviceArgument("deviceId", Argument.OPTIONAL, "Target device", BlockDeviceAPI.class); + new DeviceArgument("deviceId", Argument.OPTIONAL, "Target device", IDEDeviceAPI.class); public FdiskCommand() { super("perform disk partition management tasks"); @@ -200,14 +202,13 @@ private void listAvailableDevices(DeviceManager dm, PrintWriter out) { final Collection<Device> allDevices = dm.getDevicesByAPI(BlockDeviceAPI.class); for (Device dev : allDevices) { - out.println("Found device : " + dev.getId() + "[" + dev.getClass() + "]"); + //out.println("Found device : " + dev.getId() + "[" + dev.getClass() + "]"); if (dev instanceof IDEDevice) { IDEDevice ideDevice = (IDEDevice) dev; IDEDriveDescriptor desc = ideDevice.getDescriptor(); if (desc.isDisk()) { - out.println(" IDE Disk : " + ideDevice.getId() + "(" + desc.getModel() + - " " + desc.getSectorsAddressable() * IDEConstants.SECTOR_SIZE + - ")"); + out.println("IDE Disk: " + ideDevice.getId() + "('" + desc.getModel() + "' " + + desc.getSectorsAddressable() * IDEConstants.SECTOR_SIZE + " bytes)"); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2011-08-16 20:43:39
|
Revision: 5847 http://jnode.svn.sourceforge.net/jnode/?rev=5847&view=rev Author: lsantha Date: 2011-08-16 20:43:33 +0000 (Tue, 16 Aug 2011) Log Message: ----------- Customizing the GRUB menu for JNode CD image. Modified Paths: -------------- trunk/jnode.properties.dist Modified: trunk/jnode.properties.dist =================================================================== --- trunk/jnode.properties.dist 2011-08-16 20:19:43 UTC (rev 5846) +++ trunk/jnode.properties.dist 2011-08-16 20:43:33 UTC (rev 5847) @@ -10,6 +10,9 @@ # if you have custom initjars to build. # custom.plugin-list.dir = ${root.dir}/local/plugin-lists/ +# Custom GRUB menu for JNode CD image +#grub.menu.cdrom=${root.dir}/local/menu-cdrom.lst + # Uncomment this property if you do not want the default initjars to be build. # no.default.initjars = 1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ga...@us...> - 2011-08-11 11:42:19
|
Revision: 5845 http://jnode.svn.sourceforge.net/jnode/?rev=5845&view=rev Author: galatnm Date: 2011-08-11 11:42:10 +0000 (Thu, 11 Aug 2011) Log Message: ----------- FS : clean up HFS+ code. Modified Paths: -------------- trunk/JNode.ipr trunk/fs/src/fs/org/jnode/fs/ext2/Ext2File.java trunk/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java trunk/fs/src/fs/org/jnode/fs/ext2/Superblock.java trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusDirectory.java trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusEntry.java trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusFile.java trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusFileSystem.java trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusFileSystemType.java trunk/fs/src/fs/org/jnode/fs/hfsplus/catalog/Catalog.java trunk/fs/src/fs/org/jnode/fs/spi/AbstractFSFile.java trunk/fs/src/test/org/jnode/fs/hfsplus/HfsPlusFileSystemTest.java Added Paths: ----------- trunk/fs/src/fs/org/jnode/fs/hfsplus/SuperBlock.java Removed Paths: ------------- trunk/fs/src/fs/org/jnode/fs/hfsplus/Superblock.java Modified: trunk/JNode.ipr =================================================================== --- trunk/JNode.ipr 2011-08-07 08:53:41 UTC (rev 5844) +++ trunk/JNode.ipr 2011-08-11 11:42:10 UTC (rev 5845) @@ -17,11 +17,11 @@ <component name="CheckStyle-IDEA"> <option name="configuration"> <map> - <entry key="active-configuration" value="FILE:$PROJECT_DIR$/all/jnode_checks.xml:JNode" /> + <entry key="active-configuration" value="FILE:/home/flesire/developement/sources/jnode/jnode.orig/all/jnode_checks.xml:JNode" /> <entry key="check-test-classes" value="true" /> <entry key="config-file" value="$PROJECT_DIR$/all/jnode_checks.xml" /> <entry key="location-0" value="CLASSPATH:/sun_checks.xml:The default CheckStyle rules." /> - <entry key="location-1" value="FILE:$PROJECT_DIR$/all/jnode_checks.xml:JNode" /> + <entry key="location-1" value="FILE:/home/flesire/developement/sources/jnode/jnode.orig/all/jnode_checks.xml:JNode" /> <entry key="thirdparty-classpath" value="" /> </map> </option> @@ -214,12 +214,13 @@ </component> <component name="IdProvider" IDEtalkID="435AAC2234C36B0F2257FA7F02C447FB" /> <component name="InspectionProjectProfileManager"> - <list size="5"> + <list size="6"> <item index="0" class="java.lang.String" itemvalue="SERVER PROBLEM" /> - <item index="1" class="java.lang.String" itemvalue="INFO" /> - <item index="2" class="java.lang.String" itemvalue="TYPO" /> - <item index="3" class="java.lang.String" itemvalue="WARNING" /> - <item index="4" class="java.lang.String" itemvalue="ERROR" /> + <item index="1" class="java.lang.String" itemvalue="WEAK WARNING" /> + <item index="2" class="java.lang.String" itemvalue="INFO" /> + <item index="3" class="java.lang.String" itemvalue="TYPO" /> + <item index="4" class="java.lang.String" itemvalue="WARNING" /> + <item index="5" class="java.lang.String" itemvalue="ERROR" /> </list> </component> <component name="JavacSettings"> Modified: trunk/fs/src/fs/org/jnode/fs/ext2/Ext2File.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/ext2/Ext2File.java 2011-08-07 08:53:41 UTC (rev 5844) +++ trunk/fs/src/fs/org/jnode/fs/ext2/Ext2File.java 2011-08-11 11:42:10 UTC (rev 5845) @@ -45,32 +45,13 @@ log.setLevel(Level.DEBUG); } - /** - * @see org.jnode.fs.FSFile#getLength() - */ + @Override public long getLength() { //log.debug("getLength(): "+iNode.getSize()); return iNode.getSize(); } - private long getLengthInBlocks() { - return iNode.getSizeInBlocks(); - } - - private void rereadInode() throws IOException { - int iNodeNr = iNode.getINodeNr(); - try { - iNode = ((Ext2FileSystem) getFileSystem()).getINode(iNodeNr); - } catch (FileSystemException ex) { - final IOException ioe = new IOException(); - ioe.initCause(ex); - throw ioe; - } - } - - /** - * @see org.jnode.fs.FSFile#setLength(long) - */ + @Override public void setLength(long length) throws IOException { if (!canWrite()) throw new ReadOnlyFileSystemException("FileSystem or File is readonly"); @@ -163,9 +144,9 @@ } // synchronized(inode) } - /** - * @see org.jnode.fs.FSFile#read(long, ByteBuffer) - */ + + + @Override public void read(long fileOffset, ByteBuffer destBuf) throws IOException { final int len = destBuf.remaining(); final int off = 0; @@ -174,8 +155,7 @@ final byte[] dest = destBA.toArray(); //synchronize to the inode cache to make sure that the inode does not - // get - //flushed between reading it and locking it + // get flushed between reading it and locking it synchronized (((Ext2FileSystem) getFileSystem()).getInodeCache()) { //reread the inode before synchronizing to it to make sure //all threads use the same instance @@ -228,13 +208,7 @@ destBA.refreshByteBuffer(); } - /** - * Write into the file. fileOffset is between 0 and getLength() (see the - * methods write(byte[], int, int), setPosition(long), setLength(long) in - * org.jnode.fs.service.def.FileHandleImpl) - * - * @see org.jnode.fs.FSFile#write(long, ByteBuffer) - */ + @Override public void write(long fileOffset, ByteBuffer srcBuf) throws IOException { final int len = srcBuf.remaining(); final int off = 0; @@ -331,11 +305,7 @@ } } - /** - * Flush any cached data to the disk. - * - * @throws IOException - */ + @Override public void flush() throws IOException { log.debug("Ext2File.flush()"); iNode.update(); @@ -343,4 +313,19 @@ //been allocated or deallocated iNode.getExt2FileSystem().updateFS(); } + + private long getLengthInBlocks() { + return iNode.getSizeInBlocks(); + } + + private void rereadInode() throws IOException { + int iNodeNr = iNode.getINodeNr(); + try { + iNode = ((Ext2FileSystem) getFileSystem()).getINode(iNodeNr); + } catch (FileSystemException ex) { + final IOException ioe = new IOException(); + ioe.initCause(ex); + throw ioe; + } + } } Modified: trunk/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java 2011-08-07 08:53:41 UTC (rev 5844) +++ trunk/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java 2011-08-11 11:42:10 UTC (rev 5845) @@ -91,7 +91,7 @@ // skip the first 1024 bytes (bootsector) and read the superblock // TODO: the superblock should read itself getApi().read(1024, data); - // superblock = new Superblock(data, this); + // superblock = new SuperBlock(data, this); superblock = new Superblock(); superblock.read(data.array(), this); Modified: trunk/fs/src/fs/org/jnode/fs/ext2/Superblock.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/ext2/Superblock.java 2011-08-07 08:53:41 UTC (rev 5844) +++ trunk/fs/src/fs/org/jnode/fs/ext2/Superblock.java 2011-08-11 11:42:10 UTC (rev 5845) @@ -157,7 +157,7 @@ setPreallocBlocks(8); setPreallocDirBlocks(0); - log.debug("Superblock.create(): getBlockSize(): " + getBlockSize()); + log.debug("SuperBlock.create(): getBlockSize(): " + getBlockSize()); } /** @@ -693,7 +693,7 @@ } /** - * @return the Superblock's dirty flag + * @return the SuperBlock's dirty flag */ public boolean isDirty() { return dirty; Modified: trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusDirectory.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusDirectory.java 2011-08-07 08:53:41 UTC (rev 5844) +++ trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusDirectory.java 2011-08-11 11:42:10 UTC (rev 5845) @@ -29,6 +29,7 @@ import org.apache.log4j.Logger; import org.jnode.fs.FSDirectory; import org.jnode.fs.FSEntry; +import org.jnode.fs.FileSystem; import org.jnode.fs.ReadOnlyFileSystemException; import org.jnode.fs.hfsplus.catalog.Catalog; import org.jnode.fs.hfsplus.catalog.CatalogFile; @@ -38,26 +39,29 @@ import org.jnode.fs.hfsplus.tree.LeafRecord; import org.jnode.fs.spi.FSEntryTable; -public class HfsPlusDirectory extends HfsPlusEntry implements FSDirectory { +public class HfsPlusDirectory implements FSDirectory { private static final Logger log = Logger.getLogger(HfsPlusDirectory.class); + /** The directory entry */ + private HfsPlusEntry entry; + /** Table of entries of our parent */ private FSEntryTable entries; + /** The catalog directory record */ private CatalogFolder folder; - public HfsPlusDirectory(HfsPlusFileSystem fs, HfsPlusDirectory parent, String name, - LeafRecord record) { - super(fs, parent, name, record); - this.folder = new CatalogFolder(record.getData()); + public HfsPlusDirectory(HfsPlusEntry entry) { + this.entry = entry; + this.folder = new CatalogFolder(entry.getData()); this.entries = FSEntryTable.EMPTY_TABLE; } @Override public FSEntry addDirectory(String name) throws IOException { log.debug("<<< BEGIN addDirectory " + name + " >>>"); - if (fs.isReadOnly()) { + if (getFileSystem().isReadOnly()) { throw new ReadOnlyFileSystemException(); } @@ -73,7 +77,7 @@ @Override public FSEntry addFile(String name) throws IOException { log.debug("<<< BEGIN addFile " + name + " >>>"); - if (fs.isReadOnly()) { + if (getFileSystem().isReadOnly()) { throw new ReadOnlyFileSystemException(); } if (getEntry(name) != null) { @@ -86,10 +90,11 @@ return newEntry; } - private final FSEntry createFileEntry(final String name) throws IOException { + private FSEntry createFileEntry(final String name) throws IOException { + //TODO implements this method. /* * if (fs.isReadOnly()) { throw new ReadOnlyFileSystemException(); } - * Catalog catalog = fs.getCatalog(); Superblock volumeHeader = + * Catalog catalog = fs.getCatalog(); SuperBlock volumeHeader = * ((HfsPlusFileSystem) getFileSystem()).getVolumeHeader(); LeafRecord * fileRecord = catalog.createNode(name, this.folder .getFolderId(), new * CatalogNodeId(volumeHeader.getNextCatalogId()), @@ -107,14 +112,14 @@ @Override public void flush() throws IOException { log.debug("<<< BEGIN flush >>>"); - if (fs.isReadOnly()) { + if (getFileSystem().isReadOnly()) { throw new ReadOnlyFileSystemException(); } boolean flushEntries = isEntriesLoaded() && entries.isDirty(); - if (isDirty() || flushEntries) { + if (entry.isDirty() || flushEntries) { writeEntries(entries); // entries.resetDirty(); - resetDirty(); + entry.resetDirty(); } log.debug("<<< END flush >>>"); } @@ -137,13 +142,12 @@ @Override public void remove(String name) throws IOException { - if (fs.isReadOnly()) { + if (getFileSystem().isReadOnly()) { throw new ReadOnlyFileSystemException(); } if (entries.remove(name) >= 0) { - setDirty(); + entry.setDirty(); flush(); - return; } else { throw new FileNotFoundException(name); } @@ -160,7 +164,7 @@ if (!isEntriesLoaded()) { log.debug("checkEntriesLoaded : loading"); try { - if (rights.canRead()) { + if (entry.getAccessRights().canRead()) { entries = readEntries(); log.debug("Load " + entries.size() + " entrie(s)."); } else { @@ -169,7 +173,7 @@ entries = FSEntryTable.EMPTY_TABLE; log.debug("checkEntriesLoaded : can't read, using EMPTY_TABLE"); } - resetDirty(); + entry.resetDirty(); } catch (IOException e) { log.fatal("unable to read directory entries", e); // the next time, we will call checkEntriesLoaded() @@ -185,16 +189,16 @@ * * @return if the entries are already loaded from the device */ - private final boolean isEntriesLoaded() { + private boolean isEntriesLoaded() { return (entries != FSEntryTable.EMPTY_TABLE); } /** * - * @return + * @return read all entries link to the current directory in the file system. * @throws IOException */ - private final FSEntryTable readEntries() throws IOException { + private FSEntryTable readEntries() throws IOException { List<FSEntry> pathList = new LinkedList<FSEntry>(); HfsPlusFileSystem fs = (HfsPlusFileSystem) getFileSystem(); if (fs.getVolumeHeader().getFolderCount() > 0) { @@ -203,7 +207,7 @@ if (rec.getType() == CatalogFolder.RECORD_TYPE_FOLDER || rec.getType() == CatalogFile.RECORD_TYPE_FILE) { String name = ((CatalogKey) rec.getKey()).getNodeName().getUnicodeString(); - HfsPlusEntry e = new HfsPlusDirectory(fs, this, name, rec); + HfsPlusEntry e = new HfsPlusEntry(fs, this, name, rec); pathList.add(e); } } @@ -217,23 +221,23 @@ /** * - * @param name - * @return - * @throws IOException + * @param name The name of the entry. + * @return Return the newly created entry. + * @throws IOException if problem occurs during catalog node creation or if system is read-only. */ - private final FSEntry createDirectoryEntry(final String name) throws IOException { - if (fs.isReadOnly()) { + private FSEntry createDirectoryEntry(final String name) throws IOException { + if (getFileSystem().isReadOnly()) { throw new ReadOnlyFileSystemException(); } - Catalog catalog = fs.getCatalog(); - Superblock volumeHeader = ((HfsPlusFileSystem) getFileSystem()).getVolumeHeader(); + Catalog catalog = ((HfsPlusFileSystem)getFileSystem()).getCatalog(); + SuperBlock volumeHeader = ((HfsPlusFileSystem) getFileSystem()).getVolumeHeader(); LeafRecord folderRecord = catalog.createNode(name, this.folder.getFolderId(), new CatalogNodeId(volumeHeader.getNextCatalogId()), CatalogFolder.RECORD_TYPE_FOLDER_THREAD); folder.setValence(folder.getValence() + 1); - HfsPlusEntry newEntry = new HfsPlusDirectory(fs, this, name, folderRecord); + HfsPlusEntry newEntry = new HfsPlusEntry((HfsPlusFileSystem)getFileSystem(), this, name, folderRecord); newEntry.setDirty(); volumeHeader.setFolderCount(volumeHeader.getFolderCount() + 1); log.debug("New volume header :\n" + volumeHeader.toString()); @@ -247,14 +251,22 @@ * @param newEntry * @throws IOException */ - private final void setFreeEntry(FSEntry newEntry) throws IOException { + private void setFreeEntry(FSEntry newEntry) throws IOException { checkEntriesLoaded(); if (entries.setFreeEntry(newEntry) >= 0) { log.debug("setFreeEntry: free entry found !"); - setDirty(); + entry.setDirty(); flush(); - return; } } + @Override + public boolean isValid() { + return entry.isValid(); + } + + @Override + public FileSystem<?> getFileSystem() { + return entry.getFileSystem(); + } } Modified: trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusEntry.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusEntry.java 2011-08-07 08:53:41 UTC (rev 5844) +++ trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusEntry.java 2011-08-11 11:42:10 UTC (rev 5845) @@ -26,6 +26,7 @@ import org.jnode.fs.FSDirectory; import org.jnode.fs.FSEntry; import org.jnode.fs.FSFile; +import org.jnode.fs.FSObject; import org.jnode.fs.FileSystem; import org.jnode.fs.hfsplus.catalog.CatalogFile; import org.jnode.fs.hfsplus.catalog.CatalogFolder; @@ -87,7 +88,7 @@ if (!isDirectory()) { throw new IOException("It is not a Directory"); } - return (HfsPlusDirectory) this; + return new HfsPlusDirectory(this); } @Override @@ -95,7 +96,7 @@ if (!isFile()) { throw new IOException("It is not a file"); } - return (HfsPlusFile) this; + return new HfsPlusFile(this); } @Override @@ -164,4 +165,8 @@ return valid; } + public byte[] getData(){ + return this.record.getData(); + } + } Modified: trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusFile.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusFile.java 2011-08-07 08:53:41 UTC (rev 5844) +++ trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusFile.java 2011-08-11 11:42:10 UTC (rev 5845) @@ -24,17 +24,19 @@ import java.nio.ByteBuffer; import org.jnode.fs.FSFile; +import org.jnode.fs.FileSystem; import org.jnode.fs.hfsplus.catalog.CatalogFile; import org.jnode.fs.hfsplus.extent.ExtentDescriptor; import org.jnode.fs.hfsplus.tree.LeafRecord; -public class HfsPlusFile extends HfsPlusEntry implements FSFile { +public class HfsPlusFile implements FSFile { + private HfsPlusEntry entry; + private CatalogFile file; - public HfsPlusFile(HfsPlusFileSystem fs, HfsPlusDirectory parent, String name, LeafRecord record) { - super(fs, parent, name, record); - this.file = new CatalogFile(record.getData()); + public HfsPlusFile(HfsPlusEntry entry) { + this.file = new CatalogFile(entry.getData()); } @Override @@ -48,11 +50,16 @@ } @Override + public void setLength(final long length) throws IOException { + // TODO Auto-generated method stub + } + + @Override public final void read(final long fileOffset, final ByteBuffer dest) throws IOException { HfsPlusFileSystem fs = (HfsPlusFileSystem) getFileSystem(); for (ExtentDescriptor d : file.getDatas().getExtents()) { if (!d.isEmpty()) { - long firstOffset = d.getStartOffset(fs.getVolumeHeader().getBlockSize()); + long firstOffset = (long) d.getStartOffset(fs.getVolumeHeader().getBlockSize()); fs.getApi().read(firstOffset, dest); } } @@ -64,9 +71,14 @@ } - public void setLength(final long length) throws IOException { - // TODO Auto-generated method stub + @Override + public boolean isValid() { + return entry.isValid(); } + @Override + public FileSystem<?> getFileSystem() { + return entry.getFileSystem(); + } } Modified: trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusFileSystem.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusFileSystem.java 2011-08-07 08:53:41 UTC (rev 5844) +++ trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusFileSystem.java 2011-08-11 11:42:10 UTC (rev 5845) @@ -37,7 +37,7 @@ private final Logger log = Logger.getLogger(getClass()); /** HFS volume header */ - private Superblock volumeHeader; + private SuperBlock volumeHeader; /** Catalog special file for this instance */ private Catalog catalog; @@ -55,22 +55,22 @@ } /** - * + * * @throws FileSystemException */ public final void read() throws FileSystemException { - volumeHeader = new Superblock(this, false); + volumeHeader = new SuperBlock(this, false); log.debug(volumeHeader.toString()); - if (!volumeHeader.isAttribute(Superblock.HFSPLUS_VOL_UNMNT_BIT)) { + if (!volumeHeader.isAttribute(SuperBlock.HFSPLUS_VOL_UNMNT_BIT)) { log.info(getDevice().getId() + " Filesystem has not been cleanly unmounted, mounting it readonly"); setReadOnly(true); } - if (volumeHeader.isAttribute(Superblock.HFSPLUS_VOL_SOFTLOCK_BIT)) { + if (volumeHeader.isAttribute(SuperBlock.HFSPLUS_VOL_SOFTLOCK_BIT)) { log.info(getDevice().getId() + " Filesystem is marked locked, mounting it readonly"); setReadOnly(true); } - if (volumeHeader.isAttribute(Superblock.HFSPLUS_VOL_JOURNALED_BIT)) { + if (volumeHeader.isAttribute(SuperBlock.HFSPLUS_VOL_JOURNALED_BIT)) { log .info(getDevice().getId() + " Filesystem is journaled, write access is not supported. Mounting it readonly"); @@ -98,35 +98,20 @@ log.info("Create root entry."); LeafRecord record = catalog.getRecord(CatalogNodeId.HFSPLUS_POR_CNID); if (record != null) { - return new HfsPlusDirectory(this, null, "/", record); + return new HfsPlusEntry(this, null, "/", record); } log.error("Root entry : No record found."); return null; } - /* - * (non-Javadoc) - * - * @see org.jnode.fs.FileSystem#getFreeSpace() - */ public final long getFreeSpace() { return volumeHeader.getFreeBlocks() * volumeHeader.getBlockSize(); } - /* - * (non-Javadoc) - * - * @see org.jnode.fs.FileSystem#getTotalSpace() - */ public final long getTotalSpace() { return volumeHeader.getTotalBlocks() * volumeHeader.getBlockSize(); } - /* - * (non-Javadoc) - * - * @see org.jnode.fs.FileSystem#getUsableSpace() - */ public final long getUsableSpace() { return -1; } @@ -135,7 +120,7 @@ return catalog; } - public final Superblock getVolumeHeader() { + public final SuperBlock getVolumeHeader() { return volumeHeader; } @@ -147,7 +132,7 @@ * @throws FileSystemException */ public void create(HFSPlusParams params) throws FileSystemException { - volumeHeader = new Superblock(this, true); + volumeHeader = new SuperBlock(this, true); try { params.initializeDefaultsValues(this); volumeHeader.create(params); Modified: trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusFileSystemType.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusFileSystemType.java 2011-08-07 08:53:41 UTC (rev 5844) +++ trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusFileSystemType.java 2011-08-11 11:42:10 UTC (rev 5845) @@ -63,7 +63,7 @@ return false; } int magicNumber = BigEndian.getInt16(magic.array(), 0); - return (magicNumber == Superblock.HFSPLUS_SUPER_MAGIC); + return (magicNumber == SuperBlock.HFSPLUS_SUPER_MAGIC); } } Copied: trunk/fs/src/fs/org/jnode/fs/hfsplus/SuperBlock.java (from rev 5844, trunk/fs/src/fs/org/jnode/fs/hfsplus/Superblock.java) =================================================================== --- trunk/fs/src/fs/org/jnode/fs/hfsplus/SuperBlock.java (rev 0) +++ trunk/fs/src/fs/org/jnode/fs/hfsplus/SuperBlock.java 2011-08-11 11:42:10 UTC (rev 5845) @@ -0,0 +1,475 @@ +/* + * $Id$ + * + * Copyright (C) 2003-2010 JNode.org + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; If not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package org.jnode.fs.hfsplus; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.util.Calendar; +import java.util.Date; + +import org.apache.log4j.Level; +import org.apache.log4j.Logger; +import org.jnode.fs.FileSystemException; +import org.jnode.fs.hfsplus.catalog.CatalogNodeId; +import org.jnode.fs.hfsplus.extent.ExtentDescriptor; +import org.jnode.util.BigEndian; +import org.jnode.util.NumberUtils; + +/** + * HFS+ volume header definition. + * + * @author Fabien Lesire + * + */ +public class SuperBlock extends HfsPlusObject { + + public static final int HFSPLUS_SUPER_MAGIC = 0x482b; + + public static final int HFSPLUS_MIN_VERSION = 0x0004; /* HFS+ */ + public static final int HFSPLUS_CURRENT_VERSION = 5; /* HFSX */ + + /* HFS+ volume attributes */ + public static final int HFSPLUS_VOL_UNMNT_BIT = 8; + public static final int HFSPLUS_VOL_SPARE_BLK_BIT = 9; + public static final int HFSPLUS_VOL_NOCACHE_BIT = 10; + public static final int HFSPLUS_VOL_INCNSTNT_BIT = 11; + public static final int HFSPLUS_VOL_NODEID_REUSED_BIT = 12; + public static final int HFSPLUS_VOL_JOURNALED_BIT = 13; + public static final int HFSPLUS_VOL_SOFTLOCK_BIT = 15; + + private final Logger log = Logger.getLogger(getClass()); + + /** Volume header data length */ + public static final int SUPERBLOCK_LENGTH = 1024; + + /** Data bytes array that contains volume header information */ + private byte[] data; + + /** + * Create the volume header and load information for the file system passed + * as parameter. + * + * @param fs The file system contains HFS+ partition. + * + * @throws FileSystemException If magic number (0X482B) is incorrect or not + * available. + */ + public SuperBlock(final HfsPlusFileSystem fs, boolean create) throws FileSystemException { + super(fs); + log.setLevel(Level.INFO); + data = new byte[SUPERBLOCK_LENGTH]; + try { + if (!create) { + log.info("load HFS+ volume header."); + // skip the first 1024 bytes (boot sector) and read the volume + // header. + ByteBuffer b = ByteBuffer.allocate(SUPERBLOCK_LENGTH); + fs.getApi().read(1024, b); + data = new byte[SUPERBLOCK_LENGTH]; + System.arraycopy(b.array(), 0, data, 0, SUPERBLOCK_LENGTH); + if (getMagic() != HFSPLUS_SUPER_MAGIC) { + throw new FileSystemException("Not hfs+ volume header (" + getMagic() + + ": bad magic)"); + } + + } + } catch (IOException e) { + throw new FileSystemException(e); + } + } + + /** + * Create a new volume header. + * + * @param params File system format parameters. + * @throws IOException + */ + public void create(HFSPlusParams params) throws IOException { + log.info("Create new HFS+ volume header (" + params.getVolumeName() + + ") with block size of " + params.getBlockSize() + " bytes."); + int burnedBlocksBeforeVH = 0; + int burnedBlocksAfterAltVH = 0; + /* + * Volume header is located at sector 2. Block before this position must + * be invalidated. + */ + int blockSize = params.getBlockSize(); + if (blockSize == 512) { + burnedBlocksBeforeVH = 2; + burnedBlocksAfterAltVH = 1; + } else if (blockSize == 1024) { + burnedBlocksBeforeVH = 1; + } + // Populate volume header. + this.setMagic(HFSPLUS_SUPER_MAGIC); + this.setVersion(HFSPLUS_MIN_VERSION); + // Set attributes. + this.setAttribute(HFSPLUS_VOL_UNMNT_BIT); + this.setLastMountedVersion(0x446534a); + Calendar now = Calendar.getInstance(); + now.setTime(new Date()); + int macDate = HfsUtils.getNow(); + this.setCreateDate(macDate); + this.setModifyDate(macDate); + this.setCheckedDate(macDate); + // --- + this.setBlockSize(blockSize); + this.setTotalBlocks((int) params.getBlockCount()); + this.setFreeBlocks((int) params.getBlockCount()); + this.setRsrcClumpSize(params.getResourceClumpSize()); + this.setDataClumpSize(params.getDataClumpSize()); + this.setNextCatalogId(CatalogNodeId.HFSPLUS_FIRSTUSER_CNID.getId()); + // Allocation file creation + log.info("Init allocation file."); + long allocationClumpSize = getClumpSize(params.getBlockCount()); + long bitmapBlocks = allocationClumpSize / blockSize; + long blockUsed = 2 + burnedBlocksBeforeVH + burnedBlocksAfterAltVH + bitmapBlocks; + int startBlock = 1 + burnedBlocksBeforeVH; + int blockCount = (int) bitmapBlocks; + HfsPlusForkData forkdata = + new HfsPlusForkData(allocationClumpSize, (int) allocationClumpSize, + (int) bitmapBlocks); + ExtentDescriptor desc = new ExtentDescriptor(startBlock, blockCount); + forkdata.addDescriptor(0, desc); + forkdata.write(data, 112); + // Journal creation + int nextBlock = 0; + if (params.isJournaled()) { + this.setFileCount(2); + this.setAttribute(HFSPLUS_VOL_JOURNALED_BIT); + this.setNextCatalogId(this.getNextCatalogId() + 2); + this.setJournalInfoBlock(desc.getNext()); + blockUsed = blockUsed + 1 + (params.getJournalSize() / blockSize); + } else { + this.setJournalInfoBlock(0); + nextBlock = desc.getNext(); + } + // Extent B-Tree initialization + log.info("Init extent file."); + forkdata = + new HfsPlusForkData(params.getExtentClumpSize(), params.getExtentClumpSize(), + (params.getExtentClumpSize() / blockSize)); + desc = new ExtentDescriptor(nextBlock, forkdata.getTotalBlocks()); + forkdata.addDescriptor(0, desc); + forkdata.write(data, 192); + blockUsed += forkdata.getTotalBlocks(); + nextBlock = desc.getNext(); + // Catalog B-Tree initialization + log.info("Init catalog file."); + int totalBlocks = params.getCatalogClumpSize() / blockSize; + forkdata = + new HfsPlusForkData(params.getCatalogClumpSize(), params.getCatalogClumpSize(), + totalBlocks); + desc = new ExtentDescriptor(nextBlock, totalBlocks); + forkdata.addDescriptor(0, desc); + forkdata.write(data, 272); + blockUsed += totalBlocks; + + this.setFreeBlocks(this.getFreeBlocks() - (int) blockUsed); + this.setNextAllocation((int) blockUsed - 1 - burnedBlocksAfterAltVH + 10 * + (this.getCatalogFile().getClumpSize() / this.getBlockSize())); + } + + /** + * Calculate the number of blocks needed for bitmap. + * + * @param totalBlocks Total of blocks found in the device. + * @return the number of blocks. + * @throws IOException + */ + private long getClumpSize(long totalBlocks) throws IOException { + long clumpSize; + long minClumpSize = totalBlocks >> 3; + if ((totalBlocks & 7) == 0) { + ++minClumpSize; + } + clumpSize = minClumpSize; + return clumpSize; + } + + // Getters/setters + + public final int getMagic() { + return BigEndian.getInt16(data, 0); + } + + public final void setMagic(final int value) { + BigEndian.setInt16(data, 0, value); + } + + // + public final int getVersion() { + return BigEndian.getInt16(data, 2); + } + + public final void setVersion(final int value) { + BigEndian.setInt16(data, 2, value); + } + + // + public final int getAttributes() { + + return BigEndian.getInt32(data, 4); + } + + public final void setAttribute(final int attributeMaskBit) { + BigEndian.setInt32(data, 4, getAttributes() | (1 << attributeMaskBit)); + } + + // + public final int getLastMountedVersion() { + return BigEndian.getInt32(data, 8); + } + + public final void setLastMountedVersion(final int value) { + BigEndian.setInt32(data, 8, value); + } + + // + public final int getJournalInfoBlock() { + return BigEndian.getInt32(data, 12); + } + + public final void setJournalInfoBlock(final int value) { + BigEndian.setInt32(data, 12, value); + } + + // + public final long getCreateDate() { + return BigEndian.getUInt32(data, 16); + } + + public final void setCreateDate(final int value) { + BigEndian.setInt32(data, 16, value); + } + + public final long getModifyDate() { + return BigEndian.getUInt32(data, 20); + } + + public final void setModifyDate(final int value) { + BigEndian.setInt32(data, 20, value); + } + + public final long getBackupDate() { + return BigEndian.getUInt32(data, 24); + } + + public final void setBackupDate(final int value) { + BigEndian.setInt32(data, 24, value); + } + + public final long getCheckedDate() { + return BigEndian.getUInt32(data, 28); + } + + public final void setCheckedDate(final int value) { + BigEndian.setInt32(data, 28, value); + } + + // + public final int getFileCount() { + return BigEndian.getInt32(data, 32); + } + + public final void setFileCount(final int value) { + BigEndian.setInt32(data, 32, value); + } + + // + public final int getFolderCount() { + return BigEndian.getInt32(data, 36); + } + + public final void setFolderCount(final int value) { + BigEndian.setInt32(data, 36, value); + } + + // + public final int getBlockSize() { + return BigEndian.getInt32(data, 40); + } + + public final void setBlockSize(final int value) { + BigEndian.setInt32(data, 40, value); + } + + // + public final int getTotalBlocks() { + return BigEndian.getInt32(data, 44); + } + + public final void setTotalBlocks(final int value) { + BigEndian.setInt32(data, 44, value); + } + + // + public final int getFreeBlocks() { + return BigEndian.getInt32(data, 48); + } + + public final void setFreeBlocks(final int value) { + BigEndian.setInt32(data, 48, value); + } + + // + public final int getNextAllocation() { + return BigEndian.getInt32(data, 52); + } + + public final void setNextAllocation(final int value) { + BigEndian.setInt32(data, 52, value); + } + + public final long getRsrcClumpSize() { + return BigEndian.getInt32(data, 56); + } + + public final void setRsrcClumpSize(final int value) { + BigEndian.setInt32(data, 56, value); + } + + public final int getDataClumpSize() { + return BigEndian.getInt32(data, 60); + } + + public final void setDataClumpSize(final int value) { + BigEndian.setInt32(data, 60, value); + } + + public final int getNextCatalogId() { + return BigEndian.getInt32(data, 64); + } + + public final void setNextCatalogId(final int value) { + BigEndian.setInt32(data, 64, value); + } + + public final int getWriteCount() { + return BigEndian.getInt32(data, 68); + } + + public final void setWriteCount(final int value) { + BigEndian.setInt32(data, 68, value); + } + + public final long getEncodingsBmp() { + return BigEndian.getInt64(data, 72); + } + + public final void setEncodingsBmp(final long value) { + BigEndian.setInt64(data, 72, value); + } + + public final byte[] getFinderInfo() { + byte[] result = new byte[32]; + System.arraycopy(data, 80, result, 0, 32); + return result; + } + + public final HfsPlusForkData getAllocationFile() { + return new HfsPlusForkData(data, 112); + } + + public final HfsPlusForkData getExtentsFile() { + return new HfsPlusForkData(data, 192); + } + + public final HfsPlusForkData getCatalogFile() { + return new HfsPlusForkData(data, 272); + } + + public final HfsPlusForkData getAttributesFile() { + return new HfsPlusForkData(data, 352); + } + + public final HfsPlusForkData getStartupFile() { + return new HfsPlusForkData(data, 432); + } + + /** + * Get string representation of attribute. + * + * @return the string representation + */ + public final String getAttributesAsString() { + return ((isAttribute(HFSPLUS_VOL_UNMNT_BIT)) ? " kHFSVolumeUnmountedBit" : "") + + ((isAttribute(HFSPLUS_VOL_INCNSTNT_BIT)) ? " kHFSBootVolumeInconsistentBit" : "") + + ((isAttribute(HFSPLUS_VOL_JOURNALED_BIT)) ? " kHFSVolumeJournaledBit" : ""); + } + + /** + * Check if the corresponding attribute corresponding is set. + * + * @param maskBit Bit position of the attribute. See constants. + * + * @return {@code true} if attribute is set. + */ + public final boolean isAttribute(final int maskBit) { + return (((getAttributes() >> maskBit) & 0x1) != 0); + } + + public byte[] getBytes() { + return data; + } + + public void update() throws IOException { + fs.getApi().write(1024, ByteBuffer.wrap(data)); + } + + public final String toString() { + StringBuffer buffer = new StringBuffer(); + buffer.append("Magic: 0x").append(NumberUtils.hex(getMagic(), 4)).append("\n"); + buffer.append("Version: ").append(getVersion()).append("\n").append("\n"); + buffer.append("Attributes: ").append(getAttributesAsString()).append(" (").append( + getAttributes()).append(")").append("\n").append("\n"); + buffer.append("Create date: ").append( + HfsUtils.printDate(getCreateDate(), "EEE MMM d HH:mm:ss yyyy")).append("\n"); + buffer.append("Modify date: ").append( + HfsUtils.printDate(getModifyDate(), "EEE MMM d HH:mm:ss yyyy")).append("\n"); + buffer.append("Backup date: ").append( + HfsUtils.printDate(getBackupDate(), "EEE MMM d HH:mm:ss yyyy")).append("\n"); + buffer.append("Checked date: ").append( + HfsUtils.printDate(getCheckedDate(), "EEE MMM d HH:mm:ss yyyy")).append("\n") + .append("\n"); + buffer.append("File count: ").append(getFileCount()).append("\n"); + buffer.append("Folder count: ").append(getFolderCount()).append("\n").append("\n"); + buffer.append("Block size: ").append(getBlockSize()).append("\n"); + buffer.append("Total blocks: ").append(getTotalBlocks()).append("\n"); + buffer.append("Free blocks: ").append(getFreeBlocks()).append("\n").append("\n"); + buffer.append("Next catalog ID: ").append(getNextCatalogId()).append("\n"); + buffer.append("Write count: ").append(getWriteCount()).append("\n"); + buffer.append("Encoding bmp: ").append(getEncodingsBmp()).append("\n"); + buffer.append("Finder Infos: ").append(getFinderInfo()).append("\n").append("\n"); + buffer.append("Journal block: ").append(getJournalInfoBlock()).append("\n").append("\n"); + buffer.append("Allocation file").append("\n"); + buffer.append(getAllocationFile().toString()).append("\n"); + buffer.append("Extents file").append("\n"); + buffer.append(getExtentsFile().toString()).append("\n"); + buffer.append("Catalog file").append("\n"); + buffer.append(getCatalogFile().toString()).append("\n"); + buffer.append("Attributes file").append("\n"); + buffer.append(getAttributesFile().toString()).append("\n"); + buffer.append("Startup file").append("\n"); + buffer.append(getStartupFile().toString()).append("\n"); + return buffer.toString(); + } +} Property changes on: trunk/fs/src/fs/org/jnode/fs/hfsplus/SuperBlock.java ___________________________________________________________________ Added: svn:executable + * Deleted: trunk/fs/src/fs/org/jnode/fs/hfsplus/Superblock.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/hfsplus/Superblock.java 2011-08-07 08:53:41 UTC (rev 5844) +++ trunk/fs/src/fs/org/jnode/fs/hfsplus/Superblock.java 2011-08-11 11:42:10 UTC (rev 5845) @@ -1,478 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2003-2010 JNode.org - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package org.jnode.fs.hfsplus; - -import java.io.IOException; -import java.nio.ByteBuffer; -import java.util.Calendar; -import java.util.Date; - -import org.apache.log4j.Level; -import org.apache.log4j.Logger; -import org.jnode.fs.FileSystemException; -import org.jnode.fs.hfsplus.catalog.CatalogNodeId; -import org.jnode.fs.hfsplus.extent.ExtentDescriptor; -import org.jnode.util.BigEndian; -import org.jnode.util.NumberUtils; - -/** - * HFS+ volume header definition. - * - * @author Fabien Lesire - * - */ -public class Superblock extends HfsPlusObject { - - public static final int HFSPLUS_SUPER_MAGIC = 0x482b; - - public static final int HFSPLUS_MIN_VERSION = 0x0004; /* HFS+ */ - public static final int HFSPLUS_CURRENT_VERSION = 5; /* HFSX */ - - /* HFS+ volume attributes */ - public static final int HFSPLUS_VOL_UNMNT_BIT = 8; - public static final int HFSPLUS_VOL_SPARE_BLK_BIT = 9; - public static final int HFSPLUS_VOL_NOCACHE_BIT = 10; - public static final int HFSPLUS_VOL_INCNSTNT_BIT = 11; - public static final int HFSPLUS_VOL_NODEID_REUSED_BIT = 12; - public static final int HFSPLUS_VOL_JOURNALED_BIT = 13; - public static final int HFSPLUS_VOL_SOFTLOCK_BIT = 15; - - private final Logger log = Logger.getLogger(getClass()); - - /** Volume header data length */ - public static final int SUPERBLOCK_LENGTH = 1024; - - /** Data bytes array that contains volume header information */ - private byte[] data; - - /** - * Create the volume header and load information for the file system passed - * as parameter. - * - * @param fs The file system contains HFS+ partition. - * - * @throws FileSystemException If magic number (0X482B) is incorrect or not - * available. - */ - public Superblock(final HfsPlusFileSystem fs, boolean create) throws FileSystemException { - super(fs); - log.setLevel(Level.INFO); - data = new byte[SUPERBLOCK_LENGTH]; - try { - if (!create) { - log.info("load HFS+ volume header."); - // skip the first 1024 bytes (boot sector) and read the volume - // header. - ByteBuffer b = ByteBuffer.allocate(SUPERBLOCK_LENGTH); - fs.getApi().read(1024, b); - data = new byte[SUPERBLOCK_LENGTH]; - System.arraycopy(b.array(), 0, data, 0, SUPERBLOCK_LENGTH); - if (getMagic() != HFSPLUS_SUPER_MAGIC) { - throw new FileSystemException("Not hfs+ volume header (" + getMagic() + - ": bad magic)"); - } - - } - } catch (IOException e) { - throw new FileSystemException(e); - } - } - - /** - * Create a new volume header. - * - * @param params - * - * @throws IOException - * @throws ApiNotFoundException - * @throws FileSystemException - */ - public void create(HFSPlusParams params) throws IOException { - log.info("Create new HFS+ volume header (" + params.getVolumeName() + - ") with block size of " + params.getBlockSize() + " bytes."); - int burnedBlocksBeforeVH = 0; - int burnedBlocksAfterAltVH = 0; - /* - * Volume header is located at sector 2. Block before this position must - * be invalidated. - */ - int blockSize = params.getBlockSize(); - if (blockSize == 512) { - burnedBlocksBeforeVH = 2; - burnedBlocksAfterAltVH = 1; - } else if (blockSize == 1024) { - burnedBlocksBeforeVH = 1; - } - // Populate volume header. - this.setMagic(HFSPLUS_SUPER_MAGIC); - this.setVersion(HFSPLUS_MIN_VERSION); - // Set attributes. - this.setAttribute(HFSPLUS_VOL_UNMNT_BIT); - this.setLastMountedVersion(0x446534a); - Calendar now = Calendar.getInstance(); - now.setTime(new Date()); - int macDate = HfsUtils.getNow(); - this.setCreateDate(macDate); - this.setModifyDate(macDate); - this.setCheckedDate(macDate); - // --- - this.setBlockSize(blockSize); - this.setTotalBlocks((int) params.getBlockCount()); - this.setFreeBlocks((int) params.getBlockCount()); - this.setRsrcClumpSize(params.getResourceClumpSize()); - this.setDataClumpSize(params.getDataClumpSize()); - this.setNextCatalogId(CatalogNodeId.HFSPLUS_FIRSTUSER_CNID.getId()); - // Allocation file creation - log.info("Init allocation file."); - long allocationClumpSize = getClumpSize(params.getBlockCount()); - long bitmapBlocks = allocationClumpSize / blockSize; - long blockUsed = 2 + burnedBlocksBeforeVH + burnedBlocksAfterAltVH + bitmapBlocks; - int startBlock = 1 + burnedBlocksBeforeVH; - int blockCount = (int) bitmapBlocks; - HfsPlusForkData forkdata = - new HfsPlusForkData(allocationClumpSize, (int) allocationClumpSize, - (int) bitmapBlocks); - ExtentDescriptor desc = new ExtentDescriptor(startBlock, blockCount); - forkdata.addDescriptor(0, desc); - forkdata.write(data, 112); - // Journal creation - int nextBlock = 0; - if (params.isJournaled()) { - this.setFileCount(2); - this.setAttribute(HFSPLUS_VOL_JOURNALED_BIT); - this.setNextCatalogId(this.getNextCatalogId() + 2); - this.setJournalInfoBlock(desc.getNext()); - blockUsed = blockUsed + 1 + (params.getJournalSize() / blockSize); - } else { - this.setJournalInfoBlock(0); - nextBlock = desc.getNext(); - } - // Extent B-Tree initialization - log.info("Init extent file."); - forkdata = - new HfsPlusForkData(params.getExtentClumpSize(), params.getExtentClumpSize(), - (params.getExtentClumpSize() / blockSize)); - desc = new ExtentDescriptor(nextBlock, forkdata.getTotalBlocks()); - forkdata.addDescriptor(0, desc); - forkdata.write(data, 192); - blockUsed += forkdata.getTotalBlocks(); - nextBlock = desc.getNext(); - // Catalog B-Tree initialization - log.info("Init catalog file."); - int totalBlocks = params.getCatalogClumpSize() / blockSize; - forkdata = - new HfsPlusForkData(params.getCatalogClumpSize(), params.getCatalogClumpSize(), - totalBlocks); - desc = new ExtentDescriptor(nextBlock, totalBlocks); - forkdata.addDescriptor(0, desc); - forkdata.write(data, 272); - blockUsed += totalBlocks; - - this.setFreeBlocks(this.getFreeBlocks() - (int) blockUsed); - this.setNextAllocation((int) blockUsed - 1 - burnedBlocksAfterAltVH + 10 * - (this.getCatalogFile().getClumpSize() / this.getBlockSize())); - } - - /** - * Calculate the number of blocks needed for bitmap. - * - * @param totalBlocks Total of blocks found in the device. - * @return the number of blocks. - * @throws IOException - */ - private long getClumpSize(long totalBlocks) throws IOException { - long clumpSize; - long minClumpSize = totalBlocks >> 3; - if ((totalBlocks & 7) == 0) { - ++minClumpSize; - } - clumpSize = minClumpSize; - return clumpSize; - } - - // Getters/setters - - public final int getMagic() { - return BigEndian.getInt16(data, 0); - } - - public final void setMagic(final int value) { - BigEndian.setInt16(data, 0, value); - } - - // - public final int getVersion() { - return BigEndian.getInt16(data, 2); - } - - public final void setVersion(final int value) { - BigEndian.setInt16(data, 2, value); - } - - // - public final int getAttributes() { - - return BigEndian.getInt32(data, 4); - } - - public final void setAttribute(final int attributeMaskBit) { - BigEndian.setInt32(data, 4, getAttributes() | (1 << attributeMaskBit)); - } - - // - public final int getLastMountedVersion() { - return BigEndian.getInt32(data, 8); - } - - public final void setLastMountedVersion(final int value) { - BigEndian.setInt32(data, 8, value); - } - - // - public final int getJournalInfoBlock() { - return BigEndian.getInt32(data, 12); - } - - public final void setJournalInfoBlock(final int value) { - BigEndian.setInt32(data, 12, value); - } - - // - public final long getCreateDate() { - return BigEndian.getUInt32(data, 16); - } - - public final void setCreateDate(final int value) { - BigEndian.setInt32(data, 16, value); - } - - public final long getModifyDate() { - return BigEndian.getUInt32(data, 20); - } - - public final void setModifyDate(final int value) { - BigEndian.setInt32(data, 20, value); - } - - public final long getBackupDate() { - return BigEndian.getUInt32(data, 24); - } - - public final void setBackupDate(final int value) { - BigEndian.setInt32(data, 24, value); - } - - public final long getCheckedDate() { - return BigEndian.getUInt32(data, 28); - } - - public final void setCheckedDate(final int value) { - BigEndian.setInt32(data, 28, value); - } - - // - public final int getFileCount() { - return BigEndian.getInt32(data, 32); - } - - public final void setFileCount(final int value) { - BigEndian.setInt32(data, 32, value); - } - - // - public final int getFolderCount() { - return BigEndian.getInt32(data, 36); - } - - public final void setFolderCount(final int value) { - BigEndian.setInt32(data, 36, value); - } - - // - public final int getBlockSize() { - return BigEndian.getInt32(data, 40); - } - - public final void setBlockSize(final int value) { - BigEndian.setInt32(data, 40, value); - } - - // - public final int getTotalBlocks() { - return BigEndian.getInt32(data, 44); - } - - public final void setTotalBlocks(final int value) { - BigEndian.setInt32(data, 44, value); - } - - // - public final int getFreeBlocks() { - return BigEndian.getInt32(data, 48); - } - - public final void setFreeBlocks(final int value) { - BigEndian.setInt32(data, 48, value); - } - - // - public final int getNextAllocation() { - return BigEndian.getInt32(data, 52); - } - - public final void setNextAllocation(final int value) { - BigEndian.setInt32(data, 52, value); - } - - public final long getRsrcClumpSize() { - return BigEndian.getInt32(data, 56); - } - - public final void setRsrcClumpSize(final int value) { - BigEndian.setInt32(data, 56, value); - } - - public final int getDataClumpSize() { - return BigEndian.getInt32(data, 60); - } - - public final void setDataClumpSize(final int value) { - BigEndian.setInt32(data, 60, value); - } - - public final int getNextCatalogId() { - return BigEndian.getInt32(data, 64); - } - - public final void setNextCatalogId(final int value) { - BigEndian.setInt32(data, 64, value); - } - - public final int getWriteCount() { - return BigEndian.getInt32(data, 68); - } - - public final void setWriteCount(final int value) { - BigEndian.setInt32(data, 68, value); - } - - public final long getEncodingsBmp() { - return BigEndian.getInt64(data, 72); - } - - public final void setEncodingsBmp(final long value) { - BigEndian.setInt64(data, 72, value); - } - - public final byte[] getFinderInfo() { - byte[] result = new byte[32]; - System.arraycopy(data, 80, result, 0, 32); - return result; - } - - public final HfsPlusForkData getAllocationFile() { - return new HfsPlusForkData(data, 112); - } - - public final HfsPlusForkData getExtentsFile() { - return new HfsPlusForkData(data, 192); - } - - public final HfsPlusForkData getCatalogFile() { - return new HfsPlusForkData(data, 272); - } - - public final HfsPlusForkData getAttributesFile() { - return new HfsPlusForkData(data, 352); - } - - public final HfsPlusForkData getStartupFile() { - return new HfsPlusForkData(data, 432); - } - - /** - * Get string representation of attribute. - * - * @return the string representation - */ - public final String getAttributesAsString() { - return ((isAttribute(HFSPLUS_VOL_UNMNT_BIT)) ? " kHFSVolumeUnmountedBit" : "") + - ((isAttribute(HFSPLUS_VOL_INCNSTNT_BIT)) ? " kHFSBootVolumeInconsistentBit" : "") + - ((isAttribute(HFSPLUS_VOL_JOURNALED_BIT)) ? " kHFSVolumeJournaledBit" : ""); - } - - /** - * Check if the corresponding attribute corresponding is set. - * - * @param maskBit Bit position of the attribute. See constants. - * - * @return {@code true} if attribute is set. - */ - public final boolean isAttribute(final int maskBit) { - return (((getAttributes() >> maskBit) & 0x1) != 0); - } - - public byte[] getBytes() { - return data; - } - - public void update() throws IOException { - fs.getApi().write(1024, ByteBuffer.wrap(data)); - } - - public final String toString() { - StringBuffer buffer = new StringBuffer(); - buffer.append("Magic: 0x").append(NumberUtils.hex(getMagic(), 4)).append("\n"); - buffer.append("Version: ").append(getVersion()).append("\n").append("\n"); - buffer.append("Attributes: ").append(getAttributesAsString()).append(" (").append( - getAttributes()).append(")").append("\n").append("\n"); - buffer.append("Create date: ").append( - HfsUtils.printDate(getCreateDate(), "EEE MMM d HH:mm:ss yyyy")).append("\n"); - buffer.append("Modify date: ").append( - HfsUtils.printDate(getModifyDate(), "EEE MMM d HH:mm:ss yyyy")).append("\n"); - buffer.append("Backup date: ").append( - HfsUtils.printDate(getBackupDate(), "EEE MMM d HH:mm:ss yyyy")).append("\n"); - buffer.append("Checked date: ").append( - HfsUtils.printDate(getCheckedDate(), "EEE MMM d HH:mm:ss yyyy")).append("\n") - .append("\n"); - buffer.append("File count: ").append(getFileCount()).append("\n"); - buffer.append("Folder count: ").append(getFolderCount()).append("\n").append("\n"); - buffer.append("Block size: ").append(getBlockSize()).append("\n"); - buffer.append("Total blocks: ").append(getTotalBlocks()).append("\n"); - buffer.append("Free blocks: ").append(getFreeBlocks()).append("\n").append("\n"); - buffer.append("Next catalog ID: ").append(getNextCatalogId()).append("\n"); - buffer.append("Write count: ").append(getWriteCount()).append("\n"); - buffer.append("Encoding bmp: ").append(getEncodingsBmp()).append("\n"); - buffer.append("Finder Infos: ").append(getFinderInfo()).append("\n").append("\n"); - buffer.append("Journal block: ").append(getJournalInfoBlock()).append("\n").append("\n"); - buffer.append("Allocation file").append("\n"); - buffer.append(getAllocationFile().toString()).append("\n"); - buffer.append("Extents file").append("\n"); - buffer.append(getExtentsFile().toString()).append("\n"); - buffer.append("Catalog file").append("\n"); - buffer.append(getCatalogFile().toString()).append("\n"); - buffer.append("Attributes file").append("\n"); - buffer.append(getAttributesFile().toString()).append("\n"); - buffer.append("Startup file").append("\n"); - buffer.append(getStartupFile().toString()).append("\n"); - return buffer.toString(); - } -} Modified: trunk/fs/src/fs/org/jnode/fs/hfsplus/catalog/Catalog.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/hfsplus/catalog/Catalog.java 2011-08-07 08:53:41 UTC (rev 5844) +++ trunk/fs/src/fs/org/jnode/fs/hfsplus/catalog/Catalog.java 2011-08-11 11:42:10 UTC (rev 5845) @@ -29,7 +29,7 @@ import org.jnode.fs.hfsplus.HFSPlusParams; import org.jnode.fs.hfsplus.HfsPlusFileSystem; import org.jnode.fs.hfsplus.HfsUnicodeString; -import org.jnode.fs.hfsplus.Superblock; +import org.jnode.fs.hfsplus.SuperBlock; import org.jnode.fs.hfsplus.extent.ExtentDescriptor; import org.jnode.fs.hfsplus.tree.BTHeaderRecord; import org.jnode.fs.hfsplus.tree.IndexRecord; @@ -65,7 +65,7 @@ public Catalog(final HfsPlusFileSystem fs) throws IOException { log.info("Load B-Tree catalog file."); this.fs = fs; - Superblock sb = fs.getVolumeHeader(); + SuperBlock sb = fs.getVolumeHeader(); ExtentDescriptor firstExtent = sb.getCatalogFile().getExtent(0); catalogHeaderNodeOffset = firstExtent.getStartOffset(sb.getBlockSize()); if (!firstExtent.isEmpty()) { @@ -149,7 +149,7 @@ * @throws IOException */ public void update() throws IOException { - Superblock vh = fs.getVolumeHeader(); + SuperBlock vh = fs.getVolumeHeader(); int offset = vh.getCatalogFile().getExtent(0).getStartOffset(vh.getBlockSize()); fs.getApi().write(offset, this.getBytes()); } Modified: trunk/fs/src/fs/org/jnode/fs/spi/AbstractFSFile.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/spi/AbstractFSFile.java 2011-08-07 08:53:41 UTC (rev 5844) +++ trunk/fs/src/fs/org/jnode/fs/spi/AbstractFSFile.java 2011-08-11 11:42:10 UTC (rev 5845) @@ -47,6 +47,8 @@ */ public abstract long getLength(); + public abstract void setLength(long length) throws IOException; + /** * Read some data from the file * Modified: trunk/fs/src/test/org/jnode/fs/hfsplus/HfsPlusFileSystemTest.java =================================================================== --- trunk/fs/src/test/org/jnode/fs/hfsplus/HfsPlusFileSystemTest.java 2011-08-07 08:53:41 UTC (rev 5844) +++ trunk/fs/src/test/org... [truncated message content] |
From: <ls...@us...> - 2011-08-07 08:53:47
|
Revision: 5844 http://jnode.svn.sourceforge.net/jnode/?rev=5844&view=rev Author: lsantha Date: 2011-08-07 08:53:41 +0000 (Sun, 07 Aug 2011) Log Message: ----------- Added default mode to 'thread' command to show a flat thread list sorted by id. Modified Paths: -------------- trunk/cli/descriptors/org.jnode.command.system.xml trunk/cli/src/commands/org/jnode/command/system/ThreadCommand.java Modified: trunk/cli/descriptors/org.jnode.command.system.xml =================================================================== --- trunk/cli/descriptors/org.jnode.command.system.xml 2011-08-04 12:57:47 UTC (rev 5843) +++ trunk/cli/descriptors/org.jnode.command.system.xml 2011-08-07 08:53:41 UTC (rev 5844) @@ -288,6 +288,9 @@ <optional description="Display all extant JNode Threads"> <option argLabel="groupDump" shortName="g" longName="groupDump"/> </optional> + <optional description="Display all threads in thread groups"> + <option argLabel="verbose" shortName="v"/> + </optional> <argument argLabel="threadName" description="Display the named Thread"/> </syntax> <syntax alias="vminfo"> Modified: trunk/cli/src/commands/org/jnode/command/system/ThreadCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/system/ThreadCommand.java 2011-08-04 12:57:47 UTC (rev 5843) +++ trunk/cli/src/commands/org/jnode/command/system/ThreadCommand.java 2011-08-07 08:53:41 UTC (rev 5844) @@ -24,6 +24,8 @@ import java.security.AccessController; import java.security.PrivilegedAction; +import java.util.Comparator; +import java.util.TreeSet; import org.jnode.shell.AbstractCommand; import org.jnode.shell.syntax.Argument; import org.jnode.shell.syntax.FlagArgument; @@ -36,11 +38,13 @@ * @author Ewout Prangsma (ep...@us...) * @author Martin Husted Hartvig (ha...@jn...) * @author cr...@jn... + * @author Levente S\u00e1ntha */ public class ThreadCommand extends AbstractCommand { private static final String help_name = "the name of a specific thread to be printed"; - private static final String help_group = "if set, output a ThreadGroup dump"; + private static final String help_group = "output a ThreadGroup dump"; + private static final String help_verbose = "show all threads in thread groups"; private static final String help_super = "View info about all threads, or a specific thread"; private static final String SEPARATOR = ", "; @@ -50,12 +54,14 @@ private final ThreadNameArgument argName; private final FlagArgument argDump; + private final FlagArgument argVerbose; public ThreadCommand() { super(help_super); argName = new ThreadNameArgument("threadName", Argument.OPTIONAL, help_name); argDump = new FlagArgument("groupDump", Argument.OPTIONAL, help_group); - registerArguments(argName, argDump); + argVerbose = new FlagArgument("verbose", Argument.OPTIONAL, help_verbose); + registerArguments(argName, argVerbose, argDump); } public static void main(String[] args) throws Exception { @@ -82,11 +88,57 @@ // standard API. grp.list(); } else { - // Show the threads in the ThreadGroup tree. - showThreads(grp, getOutput().getPrintWriter(), threadName); + if(!argVerbose.isSet() && !argName.isSet()) { + showDefaultInfo(grp); + } else { + // Show the threads in the ThreadGroup tree. + showThreads(grp, getOutput().getPrintWriter(), threadName); + } } } + private void showDefaultInfo(ThreadGroup grp) { + TreeSet<Thread> threadSet = new TreeSet<Thread>(new Comparator<Thread>() { + @Override + public int compare(Thread t1, Thread t2) { + return Long.valueOf(t1.getId()).compareTo(t2.getId()); + } + }); + findThreads(grp, threadSet); + + PrintWriter out = getOutput().getPrintWriter(); + for(final Thread thread : threadSet) { + VmThread vmThread = AccessController.doPrivileged(new PrivilegedAction<VmThread>() { + public VmThread run() { + return ThreadHelper.getVmThread(thread); + } + }); + out.println(" " + thread.getId() + SEPARATOR + thread.getName() + SEPARATOR + thread.getPriority() + + SEPARATOR + vmThread.getThreadStateName()); + } + } + + private void findThreads(ThreadGroup grp, TreeSet<Thread> threadSet) { + final int max = grp.activeCount() * 2; + final Thread[] ts = new Thread[max]; + grp.enumerate(ts); + for (int i = 0; i < max; i++) { + final Thread t = ts[i]; + if (t != null) { + threadSet.add(t); + } + } + final int gmax = grp.activeGroupCount() * 2; + final ThreadGroup[] tgs = new ThreadGroup[gmax]; + grp.enumerate(tgs); + for (int i = 0; i < gmax; i++) { + final ThreadGroup tg = tgs[i]; + if (tg != null) { + findThreads(tg, threadSet); + } + } + } + /** * Traverse the ThreadGroups threads and its child ThreadGroups printing * information for each thread found. If 'threadName' is non-null, only This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ga...@us...> - 2011-08-04 12:57:54
|
Revision: 5843 http://jnode.svn.sourceforge.net/jnode/?rev=5843&view=rev Author: galatnm Date: 2011-08-04 12:57:47 +0000 (Thu, 04 Aug 2011) Log Message: ----------- Fix HFS+ cast exception. Modified Paths: -------------- trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusDirectory.java trunk/fs/src/fs/org/jnode/fs/hfsplus/catalog/Catalog.java trunk/fs/src/fs/org/jnode/fs/hfsplus/extent/ExtentNode.java trunk/fs/src/fs/org/jnode/fs/hfsplus/tree/AbstractNode.java trunk/fs/src/fs/org/jnode/fs/hfsplus/tree/Node.java trunk/fs/src/fs/org/jnode/fs/hfsplus/tree/NodeDescriptor.java Added Paths: ----------- trunk/fs/src/fs/org/jnode/fs/hfsplus/catalog/CatalogIndexNode.java trunk/fs/src/fs/org/jnode/fs/hfsplus/catalog/CatalogLeafNode.java Removed Paths: ------------- trunk/fs/src/fs/org/jnode/fs/hfsplus/catalog/CatalogNode.java Modified: trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusDirectory.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusDirectory.java 2011-08-02 20:04:52 UTC (rev 5842) +++ trunk/fs/src/fs/org/jnode/fs/hfsplus/HfsPlusDirectory.java 2011-08-04 12:57:47 UTC (rev 5843) @@ -17,7 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - + package org.jnode.fs.hfsplus; import java.io.FileNotFoundException; @@ -127,6 +127,7 @@ @Override public Iterator<? extends FSEntry> iterator() throws IOException { + checkEntriesLoaded(); return entries.iterator(); } @@ -161,6 +162,7 @@ try { if (rights.canRead()) { entries = readEntries(); + log.debug("Load " + entries.size() + " entrie(s)."); } else { // the next time, we will call checkEntriesLoaded() // we will retry to load entries @@ -226,8 +228,9 @@ Catalog catalog = fs.getCatalog(); Superblock volumeHeader = ((HfsPlusFileSystem) getFileSystem()).getVolumeHeader(); LeafRecord folderRecord = - catalog.createNode(name, this.folder.getFolderId(), new CatalogNodeId(volumeHeader - .getNextCatalogId()), CatalogFolder.RECORD_TYPE_FOLDER_THREAD); + catalog.createNode(name, this.folder.getFolderId(), + new CatalogNodeId(volumeHeader.getNextCatalogId()), + CatalogFolder.RECORD_TYPE_FOLDER_THREAD); folder.setValence(folder.getValence() + 1); HfsPlusEntry newEntry = new HfsPlusDirectory(fs, this, name, folderRecord); Modified: trunk/fs/src/fs/org/jnode/fs/hfsplus/catalog/Catalog.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/hfsplus/catalog/Catalog.java 2011-08-02 20:04:52 UTC (rev 5842) +++ trunk/fs/src/fs/org/jnode/fs/hfsplus/catalog/Catalog.java 2011-08-04 12:57:47 UTC (rev 5843) @@ -17,7 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - + package org.jnode.fs.hfsplus.catalog; import java.io.IOException; @@ -27,8 +27,8 @@ import org.apache.log4j.Logger; import org.jnode.fs.hfsplus.HFSPlusParams; +import org.jnode.fs.hfsplus.HfsPlusFileSystem; import org.jnode.fs.hfsplus.HfsUnicodeString; -import org.jnode.fs.hfsplus.HfsPlusFileSystem; import org.jnode.fs.hfsplus.Superblock; import org.jnode.fs.hfsplus.extent.ExtentDescriptor; import org.jnode.fs.hfsplus.tree.BTHeaderRecord; @@ -41,19 +41,19 @@ private final Logger log = Logger.getLogger(getClass()); private HfsPlusFileSystem fs; - + /** * B-Tree node descriptor */ private NodeDescriptor btnd; - + /** * B-Tree Header record */ private BTHeaderRecord bthr; - + private int catalogHeaderNodeOffset; - + private ByteBuffer buffer; /** @@ -84,7 +84,7 @@ } } - + /** * Create new Catalog * @@ -105,8 +105,8 @@ log.info("Create catalog header record."); bthr = new BTHeaderRecord(1, 1, params.getInitializeNumRecords(), 1, 1, nodeSize, - CatalogKey.MAXIMUM_KEY_LENGTH, totalNodes, freeNodes, params - .getCatalogClumpSize(), BTHeaderRecord.BT_TYPE_HFS, + CatalogKey.MAXIMUM_KEY_LENGTH, totalNodes, freeNodes, + params.getCatalogClumpSize(), BTHeaderRecord.BT_TYPE_HFS, BTHeaderRecord.KEY_COMPARE_TYPE_CASE_FOLDING, BTHeaderRecord.BT_VARIABLE_INDEX_KEYS_MASK + BTHeaderRecord.BT_BIG_KEYS_MASK); @@ -117,9 +117,9 @@ bufferLength += (rootNodePosition - bufferLength); // Create node descriptor NodeDescriptor nd = - new NodeDescriptor(0, 0, NodeDescriptor.BT_LEAF_NODE, 1, params - .getInitializeNumRecords()); - CatalogNode rootNode = new CatalogNode(nd, nodeSize); + new NodeDescriptor(0, 0, NodeDescriptor.BT_LEAF_NODE, 1, + params.getInitializeNumRecords()); + CatalogLeafNode rootNode = new CatalogLeafNode(nd, nodeSize); // First record (folder) HfsUnicodeString name = new HfsUnicodeString(params.getVolumeName()); CatalogKey ck = new CatalogKey(CatalogNodeId.HFSPLUS_POR_CNID, name); @@ -142,6 +142,7 @@ buffer.put(rootNode.getBytes()); buffer.rewind(); } + /** * Save catalog file to disk. * @@ -168,7 +169,7 @@ LeafRecord record = this.getRecord(parentId, name); if (record == null) { NodeDescriptor nd = new NodeDescriptor(0, 0, NodeDescriptor.BT_LEAF_NODE, 1, 2); - CatalogNode node = new CatalogNode(nd, 8192); + CatalogLeafNode node = new CatalogLeafNode(nd, 8192); CatalogKey key = new CatalogKey(parentId, name); CatalogThread thread = new CatalogThread(nodeType, parentId, name); record = new LeafRecord(key, thread.getBytes()); @@ -185,7 +186,7 @@ } return record; } - + /** * @param parentID * @return the leaf record, or possibly {code null}. @@ -200,18 +201,21 @@ nodeData); nodeData.rewind(); byte[] data = ByteBufferUtils.toArray(nodeData); - CatalogNode node = new CatalogNode(data, nodeSize); - while (node.isIndexNode()) { + NodeDescriptor nd = new NodeDescriptor(nodeData.array(), 0); + + while (nd.isIndexNode()) { + CatalogIndexNode node = new CatalogIndexNode(data, nodeSize); IndexRecord record = (IndexRecord) node.find(parentID); currentOffset = catalogHeaderNodeOffset + (record.getIndex() * nodeSize); nodeData = ByteBuffer.allocate(nodeSize); fs.getApi().read(currentOffset, nodeData); nodeData.rewind(); data = ByteBufferUtils.toArray(nodeData); - node = new CatalogNode(data, nodeSize); + nd = new NodeDescriptor(nodeData.array(), 0); } - if (node.isLeafNode()) { + if (nd.isLeafNode()) { + CatalogLeafNode node = new CatalogLeafNode(data, nodeSize); lr = (LeafRecord) node.find(parentID); } return lr; @@ -245,9 +249,10 @@ int nodeSize = getBTHeaderRecord().getNodeSize(); ByteBuffer nodeData = ByteBuffer.allocate(nodeSize); fs.getApi().read(catalogHeaderNodeOffset + (currentNodeNumber * nodeSize), nodeData); - CatalogNode node = new CatalogNode(nodeData.array(), nodeSize); - if (node.isIndexNode()) { - IndexRecord[] records = (IndexRecord[]) node.findChildren(parentID); + NodeDescriptor nd = new NodeDescriptor(nodeData.array(), 0); + if (nd.isIndexNode()) { + CatalogIndexNode node = new CatalogIndexNode(nodeData.array(), nodeSize); + IndexRecord[] records = (IndexRecord[]) node.findAll(parentID); List<LeafRecord> lfList = new LinkedList<LeafRecord>(); for (IndexRecord rec : records) { LeafRecord[] lfr = getRecords(parentID, rec.getIndex()); @@ -256,7 +261,8 @@ } } return lfList.toArray(new LeafRecord[lfList.size()]); - } else if (node.isLeafNode()) { + } else if (nd.isLeafNode()) { + CatalogLeafNode node = new CatalogLeafNode(nodeData.array(), nodeSize); return (LeafRecord[]) node.findAll(parentID); } else { return null; @@ -280,19 +286,21 @@ int nodeSize = getBTHeaderRecord().getNodeSize(); ByteBuffer nodeData = ByteBuffer.allocate(nodeSize); fs.getApi().read(catalogHeaderNodeOffset + (currentNodeNumber * nodeSize), nodeData); - CatalogNode node = new CatalogNode(nodeData.array(), nodeSize); + NodeDescriptor nd = new NodeDescriptor(nodeData.array(), 0); int currentOffset = 0; CatalogKey cKey = new CatalogKey(parentID, nodeName); - while (node.isIndexNode()) { + while (nd.isIndexNode()) { + CatalogIndexNode node = new CatalogIndexNode(nodeData.array(), nodeSize); IndexRecord record = (IndexRecord) node.find(cKey); currentNodeNumber = record.getIndex(); currentOffset = catalogHeaderNodeOffset + record.getIndex() * nodeSize; nodeData = ByteBuffer.allocate(nodeSize); fs.getApi().read(currentOffset, buffer); - node = new CatalogNode(nodeData.array(), nodeSize); + node = new CatalogIndexNode(nodeData.array(), nodeSize); } LeafRecord lr = null; - if (node.isLeafNode()) { + if (nd.isLeafNode()) { + CatalogLeafNode node = new CatalogLeafNode(nodeData.array(), nodeSize); lr = (LeafRecord) node.find(parentID); } return lr; Copied: trunk/fs/src/fs/org/jnode/fs/hfsplus/catalog/CatalogIndexNode.java (from rev 5842, trunk/fs/src/fs/org/jnode/fs/hfsplus/catalog/CatalogNode.java) =================================================================== --- trunk/fs/src/fs/org/jnode/fs/hfsplus/catalog/CatalogIndexNode.java (rev 0) +++ trunk/fs/src/fs/org/jnode/fs/hfsplus/catalog/CatalogIndexNode.java 2011-08-04 12:57:47 UTC (rev 5843) @@ -0,0 +1,125 @@ +/* + * $Id$ + * + * Copyright (C) 2003-2010 JNode.org + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; If not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package org.jnode.fs.hfsplus.catalog; + +import java.util.LinkedList; + +import org.jnode.fs.hfsplus.tree.AbstractNode; +import org.jnode.fs.hfsplus.tree.IndexRecord; +import org.jnode.fs.hfsplus.tree.Key; +import org.jnode.fs.hfsplus.tree.NodeDescriptor; + +public class CatalogIndexNode extends AbstractNode<IndexRecord> { + + /** + * Create a new node. + * + * @param descriptor + * @param nodeSize + */ + public CatalogIndexNode(NodeDescriptor descriptor, final int nodeSize) { + super(descriptor, nodeSize); + } + + /** + * Create node from existing data. + * + * @param nodeData + * @param nodeSize + */ + public CatalogIndexNode(final byte[] nodeData, final int nodeSize) { + super(nodeData, nodeSize); + + } + + @Override + protected void loadRecords(final byte[] nodeData) { + CatalogKey key; + int offset; + for (int i = 0; i < this.descriptor.getNumRecords(); i++) { + offset = offsets.get(i); + key = new CatalogKey(nodeData, offset); + records.add(new IndexRecord(key, nodeData, offset)); + } + } + + /** + * @param parentId + * @return a NodeRecord or {@code null} + */ + public final IndexRecord find(final CatalogNodeId parentId) { + for (IndexRecord record : records) { + Key key = record.getKey(); + if (key instanceof CatalogKey) { + if (((CatalogKey) key).getParentId().getId() == parentId.getId()) { + return record; + } + } + } + return null; + } + + /** + * Find node record based on it's key. + * + * @param key The key to search. + * @return a NodeRecord or {@code null} + */ + public IndexRecord find(final CatalogKey key) { + IndexRecord largestMatchingRecord = null; + for (int index = 0; index < this.getNodeDescriptor().getNumRecords(); index++) { + IndexRecord record = this.getNodeRecord(index); + if ((record.getKey().compareTo(key) <= 0)) { + if (largestMatchingRecord != null && + record.getKey().compareTo(largestMatchingRecord.getKey()) > 0) { + largestMatchingRecord = record; + } + } + } + return largestMatchingRecord; + } + + /** + * @param parentId + * @return an array of NodeRecords + */ + public final IndexRecord[] findAll(final CatalogNodeId parentId) { + LinkedList<IndexRecord> result = new LinkedList<IndexRecord>(); + IndexRecord largestMatchingRecord = null; + CatalogKey largestMatchingKey = null; + for (IndexRecord record : records) { + CatalogKey key = (CatalogKey) record.getKey(); + if (key.getParentId().getId() < parentId.getId() && + (largestMatchingKey == null || key.compareTo(largestMatchingKey) > 0)) { + largestMatchingKey = key; + largestMatchingRecord = record; + } else if (key.getParentId().getId() == parentId.getId()) { + result.addLast(record); + } + } + + if (largestMatchingKey != null) { + result.addFirst(largestMatchingRecord); + } + return result.toArray(new IndexRecord[result.size()]); + } + +} Added: trunk/fs/src/fs/org/jnode/fs/hfsplus/catalog/CatalogLeafNode.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/hfsplus/catalog/CatalogLeafNode.java (rev 0) +++ trunk/fs/src/fs/org/jnode/fs/hfsplus/catalog/CatalogLeafNode.java 2011-08-04 12:57:47 UTC (rev 5843) @@ -0,0 +1,79 @@ +package org.jnode.fs.hfsplus.catalog; + +import java.util.LinkedList; +import java.util.List; + +import org.jnode.fs.hfsplus.tree.AbstractNode; +import org.jnode.fs.hfsplus.tree.Key; +import org.jnode.fs.hfsplus.tree.LeafRecord; +import org.jnode.fs.hfsplus.tree.NodeDescriptor; +import org.jnode.fs.hfsplus.tree.NodeRecord; + +public class CatalogLeafNode extends AbstractNode<LeafRecord> { + /** + * Create a new node. + * + * @param descriptor + * @param nodeSize + */ + public CatalogLeafNode(NodeDescriptor descriptor, final int nodeSize) { + super(descriptor, nodeSize); + } + + /** + * Create node from existing data. + * + * @param nodeData + * @param nodeSize + */ + public CatalogLeafNode(final byte[] nodeData, final int nodeSize) { + super(nodeData, nodeSize); + + } + + @Override + protected void loadRecords(byte[] nodeData) { + CatalogKey key; + int offset; + for (int i = 0; i < this.descriptor.getNumRecords(); i++) { + offset = offsets.get(i); + key = new CatalogKey(nodeData, offset); + int recordSize = offsets.get(i + 1) - offset; + records.add(new LeafRecord(key, nodeData, offset, recordSize)); + } + } + + /** + * @param parentId + * @return a NodeRecord or {@code null} + */ + public final LeafRecord find(final CatalogNodeId parentId) { + for (LeafRecord record : records) { + Key key = record.getKey(); + if (key instanceof CatalogKey) { + if (((CatalogKey) key).getParentId().getId() == parentId.getId()) { + return record; + } + } + } + return null; + } + + /** + * @param parentId + * @return an array of NodeRecords + */ + public final LeafRecord[] findAll(final CatalogNodeId parentId) { + List<NodeRecord> list = new LinkedList<NodeRecord>(); + for (int index = 0; index < this.getNodeDescriptor().getNumRecords(); index++) { + NodeRecord record = this.getNodeRecord(index); + Key key = record.getKey(); + if (key instanceof CatalogKey && + ((CatalogKey) key).getParentId().getId() == parentId.getId()) { + list.add(record); + } + } + return list.toArray(new LeafRecord[list.size()]); + } + +} Property changes on: trunk/fs/src/fs/org/jnode/fs/hfsplus/catalog/CatalogLeafNode.java ___________________________________________________________________ Added: svn:mime-type + text/plain Deleted: trunk/fs/src/fs/org/jnode/fs/hfsplus/catalog/CatalogNode.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/hfsplus/catalog/CatalogNode.java 2011-08-02 20:04:52 UTC (rev 5842) +++ trunk/fs/src/fs/org/jnode/fs/hfsplus/catalog/CatalogNode.java 2011-08-04 12:57:47 UTC (rev 5843) @@ -1,160 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2003-2010 JNode.org - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package org.jnode.fs.hfsplus.catalog; - -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; - -import org.jnode.fs.hfsplus.tree.AbstractNode; -import org.jnode.fs.hfsplus.tree.IndexRecord; -import org.jnode.fs.hfsplus.tree.Key; -import org.jnode.fs.hfsplus.tree.LeafRecord; -import org.jnode.fs.hfsplus.tree.NodeDescriptor; -import org.jnode.fs.hfsplus.tree.NodeRecord; -import org.jnode.util.BigEndian; - -public class CatalogNode extends AbstractNode { - - /** - * Create a new node. - * @param descriptor - * @param nodeSize - */ - public CatalogNode(NodeDescriptor descriptor, final int nodeSize) { - this.descriptor = descriptor; - this.size = nodeSize; - this.records = new ArrayList<NodeRecord>(descriptor.getNumRecords()); - this.offsets = new ArrayList<Integer>(descriptor.getNumRecords() + 1); - this.offsets.add(Integer.valueOf(NodeDescriptor.BT_NODE_DESCRIPTOR_LENGTH)); - } - - /** - * Create node from existing data. - * @param nodeData - * @param nodeSize - */ - public CatalogNode(final byte[] nodeData, final int nodeSize) { - this.descriptor = new NodeDescriptor(nodeData, 0); - this.size = nodeSize; - this.records = new ArrayList<NodeRecord>(this.descriptor.getNumRecords()); - this.offsets = new ArrayList<Integer>(this.descriptor.getNumRecords() + 1); - int offset; - for (int i = 0; i < this.descriptor.getNumRecords() + 1; i++) { - offset = BigEndian.getInt16(nodeData, size - ((i + 1) * 2)); - offsets.add(Integer.valueOf(offset)); - } - CatalogKey key; - for (int i = 0; i < this.descriptor.getNumRecords(); i++) { - offset = offsets.get(i); - key = new CatalogKey(nodeData, offset); - if (isIndexNode()) { - records.add(new IndexRecord(key, nodeData, offset)); - } else { - int recordSize = offsets.get(i + 1) - offset; - records.add(new LeafRecord(key, nodeData, offset, recordSize)); - } - } - } - - @Override - public NodeRecord getNodeRecord(int index) { - return records.get(index); - } - - /** - * @param parentId - * @return a NodeRecord or {@code null} - */ - public final NodeRecord find(final CatalogNodeId parentId) { - for (NodeRecord record : records) { - Key key = record.getKey(); - if (key instanceof CatalogKey) { - if (((CatalogKey) key).getParentId().getId() == parentId.getId()) { - return record; - } - } - } - return null; - } - - /** - * Find node record based on it's key. - * - * @param key The key to search. - * @return a NodeRecord or {@code null} - */ - public NodeRecord find(final CatalogKey key) { - NodeRecord largestMatchingRecord = null; - for (int index = 0; index < this.getNodeDescriptor().getNumRecords(); index++) { - NodeRecord record = this.getNodeRecord(index); - if ((record.getKey().compareTo(key) <= 0)) { - if (largestMatchingRecord != null && - record.getKey().compareTo(largestMatchingRecord.getKey()) > 0) { - largestMatchingRecord = record; - } - } - } - return largestMatchingRecord; - } - - /** - * @param parentId - * @return an array of NodeRecords - */ - public final NodeRecord[] findChildren(final CatalogNodeId parentId) { - LinkedList<NodeRecord> result = new LinkedList<NodeRecord>(); - NodeRecord largestMatchingRecord = null; - CatalogKey largestMatchingKey = null; - for (NodeRecord record : records) { - CatalogKey key = (CatalogKey) record.getKey(); - if (key.getParentId().getId() < parentId.getId() - && (largestMatchingKey == null || key.compareTo(largestMatchingKey) > 0)) { - largestMatchingKey = key; - largestMatchingRecord = record; - } else if (key.getParentId().getId() == parentId.getId()) { - result.addLast(record); - } - } - - if (largestMatchingKey != null) { - result.addFirst(largestMatchingRecord); - } - return result.toArray(new NodeRecord[result.size()]); - } - - /** - * @param parentId - * @return an array of NodeRecords - */ - public final NodeRecord[] findAll(final CatalogNodeId parentId) { - List<NodeRecord> list = new LinkedList<NodeRecord>(); - for (int index = 0; index < this.getNodeDescriptor().getNumRecords(); index++) { - NodeRecord record = this.getNodeRecord(index); - Key key = record.getKey(); - if (key instanceof CatalogKey && ((CatalogKey) key).getParentId().getId() == parentId.getId()) { - list.add(record); - } - } - return list.toArray(new NodeRecord[list.size()]); - } - -} Modified: trunk/fs/src/fs/org/jnode/fs/hfsplus/extent/ExtentNode.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/hfsplus/extent/ExtentNode.java 2011-08-02 20:04:52 UTC (rev 5842) +++ trunk/fs/src/fs/org/jnode/fs/hfsplus/extent/ExtentNode.java 2011-08-04 12:57:47 UTC (rev 5843) @@ -17,29 +17,33 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - + package org.jnode.fs.hfsplus.extent; import org.jnode.fs.hfsplus.tree.AbstractNode; +import org.jnode.fs.hfsplus.tree.IndexRecord; import org.jnode.fs.hfsplus.tree.NodeDescriptor; -import org.jnode.fs.hfsplus.tree.NodeRecord; -public class ExtentNode extends AbstractNode { - +public class ExtentNode extends AbstractNode<IndexRecord> { + public ExtentNode(NodeDescriptor descriptor, final int nodeSize) { - this.descriptor = descriptor; - this.size = nodeSize; + super(descriptor, nodeSize); } - + public ExtentNode(final byte[] nodeData, final int nodeSize) { - this.descriptor = new NodeDescriptor(nodeData, 0); - this.size = nodeSize; + super(nodeData, nodeSize); } @Override - public NodeRecord getNodeRecord(int index) { + public IndexRecord getNodeRecord(int index) { // TODO Auto-generated method stub return null; } + @Override + protected void loadRecords(byte[] nodeData) { + // TODO Auto-generated method stub + + } + } Modified: trunk/fs/src/fs/org/jnode/fs/hfsplus/tree/AbstractNode.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/hfsplus/tree/AbstractNode.java 2011-08-02 20:04:52 UTC (rev 5842) +++ trunk/fs/src/fs/org/jnode/fs/hfsplus/tree/AbstractNode.java 2011-08-04 12:57:47 UTC (rev 5843) @@ -17,30 +17,46 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - + package org.jnode.fs.hfsplus.tree; +import java.util.ArrayList; import java.util.List; import org.jnode.util.BigEndian; -public abstract class AbstractNode implements Node { +public abstract class AbstractNode<T extends NodeRecord> implements Node<T> { protected NodeDescriptor descriptor; - protected List<NodeRecord> records; + protected List<T> records; protected List<Integer> offsets; protected int size; - @Override - public NodeDescriptor getNodeDescriptor() { - return descriptor; + public AbstractNode(NodeDescriptor descriptor, final int nodeSize) { + this.descriptor = descriptor; + this.size = nodeSize; + this.records = new ArrayList<T>(descriptor.getNumRecords()); + this.offsets = new ArrayList<Integer>(descriptor.getNumRecords() + 1); + this.offsets.add(Integer.valueOf(NodeDescriptor.BT_NODE_DESCRIPTOR_LENGTH)); } - public boolean isIndexNode() { - return this.getNodeDescriptor().getKind() == NodeDescriptor.BT_INDEX_NODE; + public AbstractNode(final byte[] nodeData, final int nodeSize) { + this.descriptor = new NodeDescriptor(nodeData, 0); + this.size = nodeSize; + this.records = new ArrayList<T>(this.descriptor.getNumRecords()); + this.offsets = new ArrayList<Integer>(this.descriptor.getNumRecords() + 1); + int offset; + for (int i = 0; i < this.descriptor.getNumRecords() + 1; i++) { + offset = BigEndian.getInt16(nodeData, size - ((i + 1) * 2)); + offsets.add(Integer.valueOf(offset)); + } + loadRecords(nodeData); } - public boolean isLeafNode() { - return this.getNodeDescriptor().getKind() == NodeDescriptor.BT_LEAF_NODE; + protected abstract void loadRecords(final byte[] nodeData); + + @Override + public NodeDescriptor getNodeDescriptor() { + return descriptor; } @Override @@ -49,10 +65,12 @@ } @Override - public abstract NodeRecord getNodeRecord(int index); + public T getNodeRecord(int index) { + return records.get(index); + } @Override - public boolean addNodeRecord(NodeRecord record) { + public boolean addNodeRecord(T record) { int freeSpace = getFreeSize(); if (freeSpace < record.getSize() + 2) { return false; @@ -107,7 +125,7 @@ public String toString() { StringBuffer b = new StringBuffer(); - b.append((this.isLeafNode()) ? "Leaf node" : "Index node").append("\n"); + b.append((this.getNodeDescriptor().isLeafNode()) ? "Leaf node" : "Index node").append("\n"); b.append(this.getNodeDescriptor().toString()).append("\n"); b.append("Offsets : ").append(offsets.toString()); return b.toString(); Modified: trunk/fs/src/fs/org/jnode/fs/hfsplus/tree/Node.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/hfsplus/tree/Node.java 2011-08-02 20:04:52 UTC (rev 5842) +++ trunk/fs/src/fs/org/jnode/fs/hfsplus/tree/Node.java 2011-08-04 12:57:47 UTC (rev 5843) @@ -17,22 +17,18 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - + package org.jnode.fs.hfsplus.tree; -public interface Node { +public interface Node<T extends NodeRecord> { public static final int OFFSET_SIZE = 2; public NodeDescriptor getNodeDescriptor(); - public boolean isIndexNode(); - - public boolean isLeafNode(); - public int getRecordOffset(int index); - public NodeRecord getNodeRecord(int index); + public T getNodeRecord(int index); /** * Insert a record in the node. @@ -41,5 +37,5 @@ * @return True if record is correctly inserted, false if there is not * enough place to insert the record. */ - public boolean addNodeRecord(NodeRecord record); + public boolean addNodeRecord(T record); } Modified: trunk/fs/src/fs/org/jnode/fs/hfsplus/tree/NodeDescriptor.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/hfsplus/tree/NodeDescriptor.java 2011-08-02 20:04:52 UTC (rev 5842) +++ trunk/fs/src/fs/org/jnode/fs/hfsplus/tree/NodeDescriptor.java 2011-08-04 12:57:47 UTC (rev 5843) @@ -17,7 +17,7 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - + package org.jnode.fs.hfsplus.tree; import org.jnode.util.BigEndian; @@ -27,22 +27,22 @@ public static final int BT_INDEX_NODE = 0; public static final int BT_HEADER_NODE = 1; public static final int BT_MAP_NODE = 2; - + /** The size of the node descriptor. */ public static final int BT_NODE_DESCRIPTOR_LENGTH = 14; - + /** The number of the next node. */ private int fLink; - + /** The number of the previous node. */ private int bLink; - + /** The type of the node. */ private int kind; - + /** The depth of this node in the B-Tree. */ private int height; - + /** The number of records in this node. */ private int numRecords; @@ -118,4 +118,16 @@ return numRecords; } + public boolean isIndexNode() { + return kind == NodeDescriptor.BT_INDEX_NODE; + } + + public boolean isLeafNode() { + return kind == NodeDescriptor.BT_LEAF_NODE; + } + + public boolean isMapNode() { + return kind == NodeDescriptor.BT_MAP_NODE; + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2011-08-02 20:04:58
|
Revision: 5842 http://jnode.svn.sourceforge.net/jnode/?rev=5842&view=rev Author: lsantha Date: 2011-08-02 20:04:52 +0000 (Tue, 02 Aug 2011) Log Message: ----------- Fixes to restarting the PS/2 mouse and keyboard devices. Modified Paths: -------------- trunk/core/src/driver/org/jnode/driver/input/AbstractInputDriver.java trunk/core/src/driver/org/jnode/driver/input/MouseInterpreter.java Modified: trunk/core/src/driver/org/jnode/driver/input/AbstractInputDriver.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/input/AbstractInputDriver.java 2011-07-31 13:48:44 UTC (rev 5841) +++ trunk/core/src/driver/org/jnode/driver/input/AbstractInputDriver.java 2011-08-02 20:04:52 UTC (rev 5842) @@ -34,16 +34,17 @@ private final ArrayList<SystemListener> listeners = new ArrayList<SystemListener>(); private QueueProcessorThread<E> eventQueueThread; - private final Queue<E> eventQueue = new Queue<E>(); + private Queue<E> eventQueue = new Queue<E>(); private InputDaemon daemon; protected final void startDispatcher(String id) { + this.eventQueue = new Queue<E>(); this.daemon = new InputDaemon(id + "-daemon"); - daemon.start(); + this.daemon.start(); this.eventQueueThread = new QueueProcessorThread<E>(id + "-dispatcher", eventQueue, new SystemEventDispatcher()); - eventQueueThread.start(); + this.eventQueueThread.start(); } protected final void stopDispatcher() { Modified: trunk/core/src/driver/org/jnode/driver/input/MouseInterpreter.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/input/MouseInterpreter.java 2011-07-31 13:48:44 UTC (rev 5841) +++ trunk/core/src/driver/org/jnode/driver/input/MouseInterpreter.java 2011-08-02 20:04:52 UTC (rev 5842) @@ -68,7 +68,9 @@ return false; } int id = d.getPointerId(); - if (id != 0) { + //todo -- 3 is for the wheel mouse identified bellow but when restarted the id remains 3 instead of + //todo -- 0 as on the first start. Investigate this anomaly. + if (id != 0 && id != 3) { // does not seem to be a mouse, more likely a tablet of touch screen log.debug("PointerId 0x" + NumberUtils.hex(id, 2)); return false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2011-07-31 13:48:50
|
Revision: 5841 http://jnode.svn.sourceforge.net/jnode/?rev=5841&view=rev Author: lsantha Date: 2011-07-31 13:48:44 +0000 (Sun, 31 Jul 2011) Log Message: ----------- Fixed javadoc. Modified Paths: -------------- trunk/core/src/driver/org/jnode/driver/RemovableDeviceAPI.java Modified: trunk/core/src/driver/org/jnode/driver/RemovableDeviceAPI.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/RemovableDeviceAPI.java 2011-07-31 13:46:34 UTC (rev 5840) +++ trunk/core/src/driver/org/jnode/driver/RemovableDeviceAPI.java 2011-07-31 13:48:44 UTC (rev 5841) @@ -75,7 +75,7 @@ throws IOException; /** - * Eject this device. + * Load this device. * * @throws IOException */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2011-07-31 13:46:40
|
Revision: 5840 http://jnode.svn.sourceforge.net/jnode/?rev=5840&view=rev Author: lsantha Date: 2011-07-31 13:46:34 +0000 (Sun, 31 Jul 2011) Log Message: ----------- Extended 'eject' command to load media with the '-t' option and to operate on the first removable media device when no device is specified. Modified Paths: -------------- trunk/fs/descriptors/org.jnode.fs.command.xml trunk/fs/src/fs/org/jnode/fs/command/EjectCommand.java Modified: trunk/fs/descriptors/org.jnode.fs.command.xml =================================================================== --- trunk/fs/descriptors/org.jnode.fs.command.xml 2011-07-31 13:43:44 UTC (rev 5839) +++ trunk/fs/descriptors/org.jnode.fs.command.xml 2011-07-31 13:46:34 UTC (rev 5840) @@ -27,7 +27,10 @@ <extension point="org.jnode.shell.syntaxes"> <syntax alias="eject"> - <argument argLabel="device" description="eject a device with a removable medium"/> + <sequence> + <optional><option argLabel="t" shortName="t" description="load a device with a removable medium"/></optional> + <optional><argument argLabel="device" description="eject a device with a removable medium"/></optional> + </sequence> </syntax> <syntax alias="mount"> <empty description="list all mounted filesystems"/> Modified: trunk/fs/src/fs/org/jnode/fs/command/EjectCommand.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/command/EjectCommand.java 2011-07-31 13:43:44 UTC (rev 5839) +++ trunk/fs/src/fs/org/jnode/fs/command/EjectCommand.java 2011-07-31 13:46:34 UTC (rev 5840) @@ -22,39 +22,65 @@ import java.io.IOException; +import java.util.Iterator; import org.jnode.driver.ApiNotFoundException; import org.jnode.driver.Device; +import org.jnode.driver.DeviceUtils; import org.jnode.driver.RemovableDeviceAPI; import org.jnode.shell.AbstractCommand; import org.jnode.shell.syntax.Argument; import org.jnode.shell.syntax.DeviceArgument; +import org.jnode.shell.syntax.FlagArgument; - /** * @author Ewout Prangsma (ep...@us...) + * @author Levente S\u00e1ntha */ public class EjectCommand extends AbstractCommand { private static final String help_device = "Device to eject the medium from"; + private static final String help_load = "Load the medium into the device"; private static final String fmt_failed = "Eject failed for %s: %s"; - private final DeviceArgument argDevice - = new DeviceArgument("device", Argument.MANDATORY | Argument.EXISTING, help_device, RemovableDeviceAPI.class); + private final DeviceArgument argDevice = new DeviceArgument("device", Argument.OPTIONAL | Argument.EXISTING, + help_device, RemovableDeviceAPI.class); + private final FlagArgument argLoad = new FlagArgument("t", Argument.OPTIONAL, help_load); public EjectCommand() { super("Eject the medium from a given device"); - registerArguments(argDevice); + registerArguments(argLoad, argDevice); } public static void main(String[] args) throws Exception { new EjectCommand().execute(args); } - public void execute() - throws ApiNotFoundException, IOException { - final Device dev = argDevice.getValue(); + public void execute() throws ApiNotFoundException, IOException { + final Device dev; + if (!argDevice.isSet()) { + Iterator<Device> iter = DeviceUtils.getDevicesByAPI(RemovableDeviceAPI.class).iterator(); + dev = iter.hasNext() ? iter.next() : null; + } else { + dev = argDevice.getValue(); + } + + if (dev == null) { + getError().getPrintWriter().println("No removable device found."); + return; + } + final RemovableDeviceAPI api = dev.getAPI(RemovableDeviceAPI.class); try { - api.eject(); + if (!api.canEject()) { + getError().getPrintWriter().format("No device found to %s.", + argLoad.isSet() ? "load" : "eject"); + return; + } + + if (argLoad.isSet()) { + api.load(); + } else { + api.eject(); + } } catch (IOException ex) { getError().getPrintWriter().format(fmt_failed, dev.getId(), ex.getLocalizedMessage()); exit(1); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2011-07-31 13:43:50
|
Revision: 5839 http://jnode.svn.sourceforge.net/jnode/?rev=5839&view=rev Author: lsantha Date: 2011-07-31 13:43:44 +0000 (Sun, 31 Jul 2011) Log Message: ----------- Added support for loading the removable media into a removable device. Modified Paths: -------------- trunk/core/src/driver/org/jnode/driver/RemovableDeviceAPI.java trunk/fs/src/driver/org/jnode/driver/block/floppy/FloppyDriver.java trunk/fs/src/driver/org/jnode/driver/block/scsi/cdrom/SCSICDROMDriver.java trunk/fs/src/driver/org/jnode/driver/block/usb/storage/scsi/USBStorageSCSIDriver.java Modified: trunk/core/src/driver/org/jnode/driver/RemovableDeviceAPI.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/RemovableDeviceAPI.java 2011-07-31 13:42:10 UTC (rev 5838) +++ trunk/core/src/driver/org/jnode/driver/RemovableDeviceAPI.java 2011-07-31 13:43:44 UTC (rev 5839) @@ -73,4 +73,12 @@ */ public void eject() throws IOException; + + /** + * Eject this device. + * + * @throws IOException + */ + public void load() + throws IOException; } Modified: trunk/fs/src/driver/org/jnode/driver/block/floppy/FloppyDriver.java =================================================================== --- trunk/fs/src/driver/org/jnode/driver/block/floppy/FloppyDriver.java 2011-07-31 13:42:10 UTC (rev 5838) +++ trunk/fs/src/driver/org/jnode/driver/block/floppy/FloppyDriver.java 2011-07-31 13:43:44 UTC (rev 5839) @@ -290,6 +290,11 @@ throw new IOException("Unsupported operation"); } + @Override + public void load() throws IOException { + throw new IOException("Unsupported operation"); + } + /** * Test if the disk has been changed and/or the format of the loaded floppy * is known. If the floppy has been changed or the format of the floppy is Modified: trunk/fs/src/driver/org/jnode/driver/block/scsi/cdrom/SCSICDROMDriver.java =================================================================== --- trunk/fs/src/driver/org/jnode/driver/block/scsi/cdrom/SCSICDROMDriver.java 2011-07-31 13:42:10 UTC (rev 5838) +++ trunk/fs/src/driver/org/jnode/driver/block/scsi/cdrom/SCSICDROMDriver.java 2011-07-31 13:43:44 UTC (rev 5839) @@ -239,6 +239,31 @@ } /** + * Load this device. + * + * @throws IOException + */ + public void load() throws IOException { + if (locked) { + throw new IOException("Device is locked"); + } + final SCSIDevice dev = (SCSIDevice) getDevice(); + try { + MMCUtils.startStopUnit(dev, CDBStartStopUnit.Action.LOAD, false); + } catch (SCSIException ex) { + final IOException ioe = new IOException(); + ioe.initCause(ex); + throw ioe; + } catch (TimeoutException ex) { + final IOException ioe = new IOException(); + ioe.initCause(ex); + throw ioe; + } catch (InterruptedException ex) { + throw new InterruptedIOException(); + } + } + + /** * Process the changed flag. * * @throws IOException Modified: trunk/fs/src/driver/org/jnode/driver/block/usb/storage/scsi/USBStorageSCSIDriver.java =================================================================== --- trunk/fs/src/driver/org/jnode/driver/block/usb/storage/scsi/USBStorageSCSIDriver.java 2011-07-31 13:42:10 UTC (rev 5838) +++ trunk/fs/src/driver/org/jnode/driver/block/usb/storage/scsi/USBStorageSCSIDriver.java 2011-07-31 13:43:44 UTC (rev 5839) @@ -217,4 +217,9 @@ // TODO Auto-generated method stub } + + @Override + public void load() throws IOException { + //To change body of implemented methods use File | Settings | File Templates. + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2011-07-31 13:42:16
|
Revision: 5838 http://jnode.svn.sourceforge.net/jnode/?rev=5838&view=rev Author: lsantha Date: 2011-07-31 13:42:10 +0000 (Sun, 31 Jul 2011) Log Message: ----------- Increased timeout for CD-ROM operations from 5s to 10s. Modified Paths: -------------- trunk/fs/src/driver/org/jnode/driver/bus/scsi/SCSIConstants.java Modified: trunk/fs/src/driver/org/jnode/driver/bus/scsi/SCSIConstants.java =================================================================== --- trunk/fs/src/driver/org/jnode/driver/bus/scsi/SCSIConstants.java 2011-07-25 07:57:25 UTC (rev 5837) +++ trunk/fs/src/driver/org/jnode/driver/bus/scsi/SCSIConstants.java 2011-07-31 13:42:10 UTC (rev 5838) @@ -35,7 +35,7 @@ /** * Group1 timeout, do not retry */ - public static final long GROUP1_TIMEOUT = 5000; + public static final long GROUP1_TIMEOUT = 10000; /** * Group2 timeout, you can retry */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2011-07-25 07:57:32
|
Revision: 5837 http://jnode.svn.sourceforge.net/jnode/?rev=5837&view=rev Author: lsantha Date: 2011-07-25 07:57:25 +0000 (Mon, 25 Jul 2011) Log Message: ----------- Patch contributed by griff with the following comments: The patch implements: 48 bit ide lba addresses. 28 bit lba addresses were implemented but 48 bit was not and it is required for larger disks (> 137G) . Extended partition tables were mostly there and just needed fixing. Fixed an exception that sometimes caused the cd to fail to load while booting from the cd. The cause was that read atapi commands did not deal with padding. Modified Paths: -------------- trunk/fs/src/driver/org/jnode/driver/block/ide/disk/IDEDiskDriver.java trunk/fs/src/driver/org/jnode/driver/bus/ide/IDEBus.java trunk/fs/src/driver/org/jnode/driver/bus/ide/IDEConstants.java trunk/fs/src/driver/org/jnode/driver/bus/ide/IDEDriveDescriptor.java trunk/fs/src/driver/org/jnode/driver/bus/ide/command/IDERWSectorsCommand.java trunk/fs/src/driver/org/jnode/driver/bus/ide/command/IDEReadSectorsCommand.java trunk/fs/src/driver/org/jnode/driver/bus/ide/command/IDEWriteSectorsCommand.java trunk/fs/src/fs/org/jnode/partitions/command/FdiskCommand.java Modified: trunk/fs/src/driver/org/jnode/driver/block/ide/disk/IDEDiskDriver.java =================================================================== --- trunk/fs/src/driver/org/jnode/driver/block/ide/disk/IDEDiskDriver.java 2011-07-15 19:52:00 UTC (rev 5836) +++ trunk/fs/src/driver/org/jnode/driver/block/ide/disk/IDEDiskDriver.java 2011-07-25 07:57:25 UTC (rev 5837) @@ -49,6 +49,7 @@ import org.jnode.driver.bus.ide.IDEDeviceFactory; import org.jnode.driver.bus.ide.IDEDriveDescriptor; import org.jnode.driver.bus.ide.IDEDriverUtils; +import org.jnode.driver.bus.ide.command.IDERWSectorsCommand; import org.jnode.driver.bus.ide.command.IDEReadSectorsCommand; import org.jnode.driver.bus.ide.command.IDEWriteSectorsCommand; import org.jnode.naming.InitialNaming; @@ -83,7 +84,7 @@ /** * Support 48-bit addressing? */ - private boolean s48bit; + private boolean is48bit; private IDEDiskBus diskBus; private IBMPartitionTable pt; @@ -97,12 +98,8 @@ final IDEDriveDescriptor descr = dev.getDescriptor(); //lba = descr.supportsLBA(); //dma = descr.supportsDMA(); - s48bit = descr.supports48bitAddressing(); - if (s48bit) { - maxSector = descr.getSectorsIn48bitAddressing(); - } else { - maxSector = descr.getSectorsIn28bitAddressing(); - } + is48bit = descr.supports48bitAddressing(); + maxSector = descr.getSectorsAddressable(); // Look for partitions try { @@ -126,17 +123,16 @@ if (pte == null) { BootLogInstance.get().warn("PartitionTableEntry #" + i + " is null"); } else if (pte.isValid()) { - if (pte.isExtended()) { - // Create partition devices for the extended partition - partIndex = registerExtendedPartition(devMan, dev, partIndex); - } else { - // Create a partition device. - registerPartition(devMan, dev, pte, partIndex); - } + registerPartition(devMan, dev, pte, partIndex); } partIndex++; i++; } + if (!pt.getExtendedPartitions().isEmpty()) { + // Create partition devices for the extended partition + log.debug("Extended"); + partIndex = registerExtendedPartition(devMan, dev, partIndex); + } } catch (DeviceAlreadyRegisteredException ex) { throw new DriverException("Partition device is already known???? Probably a bug", ex); } catch (IOException ex) { @@ -184,87 +180,66 @@ } public void read(long devOffset, ByteBuffer destBuf) throws IOException { - int destOffset = 0; - int length = destBuf.remaining(); + transfer(devOffset, destBuf, false); + } + public void write(long devOffset, ByteBuffer srcBuf) throws IOException { + transfer(devOffset, srcBuf, true); + } + + protected void transfer(long devOffset, ByteBuffer buf, boolean isWrite) throws IOException { +// int bufOffset = 0; + int length = buf.remaining(); + BlockDeviceAPIHelper.checkBounds(this, devOffset, length); BlockDeviceAPIHelper.checkAlignment(SECTOR_SIZE, this, devOffset, length); final long lbaStart = devOffset / SECTOR_SIZE; final int sectors = length / SECTOR_SIZE; + final String errorSource = isWrite ? "write" : "read"; if (lbaStart + sectors > this.maxSector) { - throw new IOException("read beyond device sectors"); + throw new IOException(errorSource + " beyond device sectors"); } final IDEDevice dev = (IDEDevice) getDevice(); final IDEBus bus = (IDEBus) dev.getBus(); + final int maxSectorCount = is48bit ? MAX_SECTOR_COUNT_48 : MAX_SECTOR_COUNT_28; while (length > 0) { final long partLbaStart = devOffset / SECTOR_SIZE; - final int partSectors = Math.min(length / SECTOR_SIZE, 256); + final int partSectors = Math.min(length / SECTOR_SIZE, maxSectorCount); final int partLength = partSectors * SECTOR_SIZE; - final IDEReadSectorsCommand cmd; - cmd = new IDEReadSectorsCommand(dev.isPrimary(), dev.isMaster(), partLbaStart, partSectors, destBuf); + final IDERWSectorsCommand cmd = isWrite ? new IDEWriteSectorsCommand( + dev.isPrimary(), + dev.isMaster(), + is48bit, + partLbaStart, + partSectors, + buf) : new IDEReadSectorsCommand( + dev.isPrimary(), + dev.isMaster(), + is48bit, + partLbaStart, + partSectors, + buf); try { bus.executeAndWait(cmd, IDE_DATA_XFER_TIMEOUT); } catch (InterruptedException ex) { - final IOException ioe = new IOException("IDE read interrupted"); - ioe.initCause(ex); - throw ioe; + throw new IOException("IDE " + errorSource + " interrupted", ex); } catch (TimeoutException ex) { throw new InterruptedIOException("IDE timeout: " + ex.getMessage()); } if (cmd.hasError()) { - throw new IOException("IDE read error:" + cmd.getError()); + throw new IOException("IDE " + errorSource + " error:" + cmd.getError()); } length -= partLength; - destOffset += partLength; devOffset += partLength; } } - public void write(long devOffset, ByteBuffer srcBuf) throws IOException { - int srcOffset = 0; - int length = srcBuf.remaining(); - - BlockDeviceAPIHelper.checkBounds(this, devOffset, length); - BlockDeviceAPIHelper.checkAlignment(SECTOR_SIZE, this, devOffset, length); - final long lbaStart = devOffset / SECTOR_SIZE; - final int sectors = length / SECTOR_SIZE; - - if (lbaStart + sectors > this.maxSector) { - throw new IOException("write beyond device sectors"); - } - - final IDEDevice dev = (IDEDevice) getDevice(); - final IDEBus bus = (IDEBus) dev.getBus(); - final IDEWriteSectorsCommand cmd; - cmd = - new IDEWriteSectorsCommand( - dev.isPrimary(), - dev.isMaster(), - lbaStart, - sectors, - srcBuf, - srcOffset, - length); - try { - bus.executeAndWait(cmd, IDE_DATA_XFER_TIMEOUT); - } catch (InterruptedException ex) { - final IOException ioe = new IOException("IDE write interrupted"); - ioe.initCause(ex); - throw ioe; - } catch (TimeoutException ex) { - throw new InterruptedIOException("IDE timeout: " + ex.getMessage()); - } - if (cmd.hasError()) { - throw new IOException("IDE write error:" + cmd.getError()); - } - } - static class IDEDiskBus extends Bus { public IDEDiskBus(IDEDevice parent) { Modified: trunk/fs/src/driver/org/jnode/driver/bus/ide/IDEBus.java =================================================================== --- trunk/fs/src/driver/org/jnode/driver/bus/ide/IDEBus.java 2011-07-15 19:52:00 UTC (rev 5836) +++ trunk/fs/src/driver/org/jnode/driver/bus/ide/IDEBus.java 2011-07-25 07:57:25 UTC (rev 5837) @@ -328,12 +328,18 @@ * @param length */ public final void readData(byte[] dst, int ofs, int length) { + final int srcLen = dst.length - ofs; + int len = Math.min(length, srcLen); //waitUntilNotBusy(); - for (; length > 0; length -= 2) { + for (; len > 0; len -= 2, length -= 2) { final int v = io.getDataReg(); dst[ofs++] = (byte) (v & 0xFF); dst[ofs++] = (byte) ((v >> 8) & 0xFF); } + // Recieve padding + for (; length > 0; length -= 2) { + io.getDataReg(); + } } /** Modified: trunk/fs/src/driver/org/jnode/driver/bus/ide/IDEConstants.java =================================================================== --- trunk/fs/src/driver/org/jnode/driver/bus/ide/IDEConstants.java 2011-07-15 19:52:00 UTC (rev 5836) +++ trunk/fs/src/driver/org/jnode/driver/bus/ide/IDEConstants.java 2011-07-25 07:57:25 UTC (rev 5837) @@ -192,6 +192,32 @@ public static final long IDE_DATA_XFER_TIMEOUT = 10000; /* ms */ // -------------------------------- + // IDE sector maximum addresses + + /** + * Maximum sector for 28 bit addresses + */ + public static final int MAX_SECTOR_COUNT_28 = 256; + + /** + * Maximum sector for 48 bit addresses + */ + public static final int MAX_SECTOR_COUNT_48 = 65536; + + // -------------------------------- + // IDE sector maximum addresses + + /** + * Maximum sector for 28 bit addresses + */ + public static final long MAX_SECTOR_28 = 0xfffffffL; + + /** + * Maximum sector for 48 bit addresses + */ + public static final long MAX_SECTOR_48 = 0xfffffffffffffL; + + // -------------------------------- // ATA/ATAPI Commands pre T13 Spec public static final int CMD_NOP = 0x00; public static final int CFA_REQ_EXT_ERROR_CODE = 0x03; /* CFA Request Extended Error Code */ Modified: trunk/fs/src/driver/org/jnode/driver/bus/ide/IDEDriveDescriptor.java =================================================================== --- trunk/fs/src/driver/org/jnode/driver/bus/ide/IDEDriveDescriptor.java 2011-07-15 19:52:00 UTC (rev 5836) +++ trunk/fs/src/driver/org/jnode/driver/bus/ide/IDEDriveDescriptor.java 2011-07-25 07:57:25 UTC (rev 5837) @@ -193,15 +193,22 @@ * @return True if this device supports 48-bit addressing, false otherwise */ public boolean supports48bitAddressing() { - return ((data[83] & 0x40) != 0); + return ((data[83] & 0x400) != 0); } /** + * Gets the number of addressable sectors + */ + public long getSectorsAddressable() { + return supports48bitAddressing() ? getSectorsIn48bitAddressing() : getSectorsIn28bitAddressing(); + } + + /** * Gets the number of addressable sectors in 28-addressing. * * @return the number of addressable sectors */ - public long getSectorsIn28bitAddressing() { + private long getSectorsIn28bitAddressing() { final long h = data[61]; final long l = data[60]; return ((h << 16) & 0xFFFF0000) | (l & 0xFFFF); @@ -212,12 +219,11 @@ * * @return the number of addressable sectors */ - public long getSectorsIn48bitAddressing() { + private long getSectorsIn48bitAddressing() { final long v3 = data[103] & 0xFFFF; final long v2 = data[102] & 0xFFFF; final long v1 = data[101] & 0xFFFF; final long v0 = data[100] & 0xFFFF; - return (v3 << 48) | (v2 << 16) | (v1 << 16) | v0; + return (v3 << 48) | (v2 << 32) | (v1 << 16) | v0; } - } Modified: trunk/fs/src/driver/org/jnode/driver/bus/ide/command/IDERWSectorsCommand.java =================================================================== --- trunk/fs/src/driver/org/jnode/driver/bus/ide/command/IDERWSectorsCommand.java 2011-07-15 19:52:00 UTC (rev 5836) +++ trunk/fs/src/driver/org/jnode/driver/bus/ide/command/IDERWSectorsCommand.java 2011-07-25 07:57:25 UTC (rev 5837) @@ -33,43 +33,69 @@ public abstract class IDERWSectorsCommand extends IDECommand { protected final long lbaStart; protected final int sectors; + protected final boolean is48bit; public IDERWSectorsCommand( boolean primary, boolean master, + boolean is48bit, long lbaStart, int sectors) { super(primary, master); + this.is48bit = is48bit; this.lbaStart = lbaStart; this.sectors = sectors; - if ((sectors < 1) || (sectors > 256)) { - throw new IllegalArgumentException("Sectors must be between 1 and 256, not " + sectors); + if (lbaStart < 0L) { + throw new IllegalArgumentException(String.format("LBA must be between 0 and {0}, not {1}", maxSector() - 1, + lbaStart)); } + if ((sectors < 1) || (sectors > maxSectorCount())) { + throw new IllegalArgumentException(String.format("Sectors must be between 1 and {0}, not {1}", + maxSectorCount(), sectors)); + } + if ((lbaStart + sectors) >= maxSector()) { + throw new IllegalArgumentException(String.format("The maximum sector must be between 0 and {0}, not {1}", + maxSector(), lbaStart + sectors)); + } } + protected long maxSector() { + return is48bit ? MAX_SECTOR_48 : MAX_SECTOR_28; + } + + protected int maxSectorCount() { + return is48bit ? MAX_SECTOR_COUNT_48 : MAX_SECTOR_COUNT_28; + } + protected void setup(IDEBus ide, IDEIO io) throws TimeoutException { - final int select; - final int sectors; - final int lbaLow = (int) (lbaStart & 0xFF); - final int lbaMid = (int) ((lbaStart >> 8) & 0xFF); - final int lbaHigh = (int) ((lbaStart >> 16) & 0xFF); - final int lbaRem = (int) ((lbaStart >> 24) & 0x0F); - if (master) { - select = lbaRem | SEL_BLANK | SEL_LBA | SEL_DRIVE_MASTER; - } else { - select = lbaRem | SEL_BLANK | SEL_LBA | SEL_DRIVE_SLAVE; + int select = SEL_LBA | getSelect(); + + final int scCurrent = sectors & 0xFF; + final int lbaLowCurrent = (int) (lbaStart & 0xFF); + final int lbaMidCurrent = (int) ((lbaStart >> 8) & 0xFF); + final int lbaHighCurrent = (int) ((lbaStart >> 16) & 0xFF); + + io.waitUntilNotBusy(IDE_TIMEOUT); + if (is48bit) { + final int scPrevious = (sectors & 0xFF00) >> 8; + final int lbaLowPrevious = (int) ((lbaStart >> 24) & 0xFF); + final int lbaMidPrevious = (int) ((lbaStart >> 32) & 0xFF); + final int lbaHighPrevious = (int) ((lbaStart >> 40) & 0xFF); + + io.setSectorCountReg(scPrevious); + io.setLbaLowReg(lbaLowPrevious); + io.setLbaMidReg(lbaMidPrevious); + io.setLbaHighReg(lbaHighPrevious); } - if (this.sectors == 256) { - sectors = 0; - } else { - sectors = this.sectors; + io.setSectorCountReg(scCurrent); + io.setLbaLowReg(lbaLowCurrent); + io.setLbaMidReg(lbaMidCurrent); + io.setLbaHighReg(lbaHighCurrent); + if (!is48bit) { + final int lbaRem = (int) ((lbaStart >> 24) & 0xF); + + select |= lbaRem; } - - io.setSectorCountReg(sectors); - io.setLbaLowReg(lbaLow); - io.setLbaMidReg(lbaMid); - io.setLbaHighReg(lbaHigh); io.setSelectReg(select); - } } Modified: trunk/fs/src/driver/org/jnode/driver/bus/ide/command/IDEReadSectorsCommand.java =================================================================== --- trunk/fs/src/driver/org/jnode/driver/bus/ide/command/IDEReadSectorsCommand.java 2011-07-15 19:52:00 UTC (rev 5836) +++ trunk/fs/src/driver/org/jnode/driver/bus/ide/command/IDEReadSectorsCommand.java 2011-07-25 07:57:25 UTC (rev 5837) @@ -32,10 +32,16 @@ public class IDEReadSectorsCommand extends IDERWSectorsCommand { private final ByteBuffer buf; - private int readSectors; + private int readSectors = 0; - public IDEReadSectorsCommand(boolean primary, boolean master, long lbaStart, int sectors, ByteBuffer dest) { - super(primary, master, lbaStart, sectors); + public IDEReadSectorsCommand( + boolean primary, + boolean master, + boolean is48bit, + long lbaStart, + int sectors, + ByteBuffer dest) { + super(primary, master, is48bit, lbaStart, sectors); buf = dest; } @@ -44,7 +50,7 @@ */ protected void setup(IDEBus ide, IDEIO io) throws TimeoutException { super.setup(ide, io); - io.setCommandReg(CMD_READ); + io.setCommandReg(is48bit ? CMD_READ_EXT : CMD_READ); } /** Modified: trunk/fs/src/driver/org/jnode/driver/bus/ide/command/IDEWriteSectorsCommand.java =================================================================== --- trunk/fs/src/driver/org/jnode/driver/bus/ide/command/IDEWriteSectorsCommand.java 2011-07-15 19:52:00 UTC (rev 5836) +++ trunk/fs/src/driver/org/jnode/driver/bus/ide/command/IDEWriteSectorsCommand.java 2011-07-25 07:57:25 UTC (rev 5837) @@ -34,25 +34,18 @@ public class IDEWriteSectorsCommand extends IDERWSectorsCommand { private final ByteBuffer buf; - private final int offset; - private final int length; - private int currentPosition; - //private int readSectors; + private int readSectors = 0; public IDEWriteSectorsCommand( boolean primary, boolean master, + boolean is48bit, long lbaStart, int sectors, - ByteBuffer src, - int srcOffset, - int length) { - super(primary, master, lbaStart, sectors); + ByteBuffer src) { + super(primary, master, is48bit, lbaStart, sectors); this.buf = src; - this.offset = srcOffset; - this.currentPosition = srcOffset; - this.length = length; } /** @@ -61,17 +54,18 @@ protected void setup(IDEBus ide, IDEIO io) throws TimeoutException { super.setup(ide, io); - io.setCommandReg(CMD_WRITE); - transfertASector(ide, io); + io.setCommandReg(is48bit ? CMD_WRITE_EXT : CMD_WRITE); + io.waitUntilNotBusy(IDE_TIMEOUT); + transferASector(ide, io); } - private void transfertASector(IDEBus ide, IDEIO io) throws TimeoutException { - io.waitUntilNotBusy(IDE_TIMEOUT); + private void transferASector(IDEBus ide, IDEIO io) throws TimeoutException { +// io.waitUntilNotBusy(IDE_TIMEOUT); for (int i = 0; i < 256; i++) { int v = ((buf.get() & 0xFF) + ((buf.get() & 0xFF) << 8)); io.setDataReg(v); - currentPosition += 2; } + readSectors++; } /** @@ -83,8 +77,8 @@ setError(io.getErrorReg()); } else { if ((state & (ST_BUSY | ST_DEVICE_READY)) == ST_DEVICE_READY) { - if (currentPosition < offset + length) { - transfertASector(ide, io); + if (readSectors < sectors) { + transferASector(ide, io); } else { notifyFinished(); } Modified: trunk/fs/src/fs/org/jnode/partitions/command/FdiskCommand.java =================================================================== --- trunk/fs/src/fs/org/jnode/partitions/command/FdiskCommand.java 2011-07-15 19:52:00 UTC (rev 5836) +++ trunk/fs/src/fs/org/jnode/partitions/command/FdiskCommand.java 2011-07-25 07:57:25 UTC (rev 5837) @@ -166,7 +166,7 @@ int sectorSize = IDEConstants.SECTOR_SIZE; if (ideDev != null) { out.println("IDE Disk : " + ideDev.getId() + ": " + - descriptor.getSectorsIn28bitAddressing() * 512 + " bytes"); + descriptor.getSectorsAddressable() * 512 + " bytes"); } out.println("Device Boot Start End Blocks System"); IBMPartitionTable partitionTable = helper.getPartitionTable(); @@ -206,7 +206,7 @@ IDEDriveDescriptor desc = ideDevice.getDescriptor(); if (desc.isDisk()) { out.println(" IDE Disk : " + ideDevice.getId() + "(" + desc.getModel() + - " " + desc.getSectorsIn28bitAddressing() * IDEConstants.SECTOR_SIZE + + " " + desc.getSectorsAddressable() * IDEConstants.SECTOR_SIZE + ")"); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2011-07-15 19:52:06
|
Revision: 5836 http://jnode.svn.sourceforge.net/jnode/?rev=5836&view=rev Author: lsantha Date: 2011-07-15 19:52:00 +0000 (Fri, 15 Jul 2011) Log Message: ----------- Nimbus L&F. Modified Paths: -------------- trunk/gui/src/desktop/org/jnode/desktop/classic/TaskBar.java Modified: trunk/gui/src/desktop/org/jnode/desktop/classic/TaskBar.java =================================================================== --- trunk/gui/src/desktop/org/jnode/desktop/classic/TaskBar.java 2011-07-15 19:51:29 UTC (rev 5835) +++ trunk/gui/src/desktop/org/jnode/desktop/classic/TaskBar.java 2011-07-15 19:52:00 UTC (rev 5836) @@ -151,6 +151,15 @@ } } + //todo fix nimbus startup +// JMenuItem nimbus = new JMenuItem("Nimbus"); +// lfMenu.add(nimbus); +// nimbus.addActionListener(new SetLFAction("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel") { +// public void actionPerformed(ActionEvent e) { +// super.actionPerformed(e); +// } +// }); + JMenuItem metal_theme = new JMenuItem("Metal Default"); lfMenu.add(metal_theme); metal_theme.addActionListener(new SetLFAction("javax.swing.plaf.metal.MetalLookAndFeel") { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2011-07-15 19:51:35
|
Revision: 5835 http://jnode.svn.sourceforge.net/jnode/?rev=5835&view=rev Author: lsantha Date: 2011-07-15 19:51:29 +0000 (Fri, 15 Jul 2011) Log Message: ----------- Added Nimbus L&F packages to plugin configuration. Modified Paths: -------------- trunk/core/descriptors/org.classpath.ext.xml Modified: trunk/core/descriptors/org.classpath.ext.xml =================================================================== --- trunk/core/descriptors/org.classpath.ext.xml 2011-07-15 19:33:35 UTC (rev 5834) +++ trunk/core/descriptors/org.classpath.ext.xml 2011-07-15 19:51:29 UTC (rev 5835) @@ -43,6 +43,8 @@ <export name="com.sun.java.swing.plaf.windows.DesktopProperty"/> <export name="com.sun.java.swing.plaf.motif.*"/> + <export name="com.sun.java.swing.plaf.nimbus.*"/> + <export name="com.sun.java.swing.plaf.*"/> <export name="com.sun.java.swing.plaf.motif.icons.*"/> <export name="com.sun.swing.internal.plaf.basic.resources.*"/> <export name="com.sun.swing.internal.plaf.metal.resources.*"/> @@ -65,6 +67,7 @@ <export name="sun.print.*"/> <export name="sun.swing.*"/> <export name="sun.swing.icon.*"/> + <export name="sun.swing.plaf.*"/> <export name="sun.swing.plaf.synth.*"/> <export name="sun.swing.plaf.windows.*"/> <export name="sun.swing.table.*"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2011-07-15 19:33:41
|
Revision: 5834 http://jnode.svn.sourceforge.net/jnode/?rev=5834&view=rev Author: lsantha Date: 2011-07-15 19:33:35 +0000 (Fri, 15 Jul 2011) Log Message: ----------- Updated project files. Modified Paths: -------------- classlib6/Classlib6.ipr Property Changed: ---------------- classlib6/netbeans/ Modified: classlib6/Classlib6.ipr =================================================================== --- classlib6/Classlib6.ipr 2011-07-15 19:32:53 UTC (rev 5833) +++ classlib6/Classlib6.ipr 2011-07-15 19:33:35 UTC (rev 5834) @@ -71,6 +71,16 @@ <option name="TERNARY_OPERATION_WRAP" value="1" /> <option name="ARRAY_INITIALIZER_WRAP" value="1" /> <option name="ASSIGNMENT_WRAP" value="1" /> + <ADDITIONAL_INDENT_OPTIONS fileType="css"> + <option name="INDENT_SIZE" value="4" /> + <option name="CONTINUATION_INDENT_SIZE" value="8" /> + <option name="TAB_SIZE" value="4" /> + <option name="USE_TAB_CHARACTER" value="false" /> + <option name="SMART_TABS" value="false" /> + <option name="LABEL_INDENT_SIZE" value="0" /> + <option name="LABEL_INDENT_ABSOLUTE" value="false" /> + <option name="USE_RELATIVE_INDENTS" value="false" /> + </ADDITIONAL_INDENT_OPTIONS> <ADDITIONAL_INDENT_OPTIONS fileType="groovy"> <option name="INDENT_SIZE" value="2" /> <option name="CONTINUATION_INDENT_SIZE" value="8" /> Property changes on: classlib6/netbeans ___________________________________________________________________ Added: svn:ignore + build This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2011-07-15 19:32:59
|
Revision: 5833 http://jnode.svn.sourceforge.net/jnode/?rev=5833&view=rev Author: lsantha Date: 2011-07-15 19:32:53 +0000 (Fri, 15 Jul 2011) Log Message: ----------- Performance optimization for CompareTask. Modified Paths: -------------- classlib6/builder/src/builder/org/jnode/ant/taskdefs/classpath/CompareTask.java Modified: classlib6/builder/src/builder/org/jnode/ant/taskdefs/classpath/CompareTask.java =================================================================== --- classlib6/builder/src/builder/org/jnode/ant/taskdefs/classpath/CompareTask.java 2011-07-15 18:38:45 UTC (rev 5832) +++ classlib6/builder/src/builder/org/jnode/ant/taskdefs/classpath/CompareTask.java 2011-07-15 19:32:53 UTC (rev 5833) @@ -28,10 +28,21 @@ import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; import java.util.Date; +import java.util.List; import java.util.Map; import java.util.TreeMap; import java.util.TreeSet; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Task; import org.apache.tools.ant.taskdefs.Execute; @@ -42,6 +53,7 @@ * version of classpath. * * @author Ewout Prangsma (ep...@us...) + * @author Levente S\u00e1ntha */ public class CompareTask extends Task { @@ -90,6 +102,94 @@ private static final int FLAG_UNSUBMITTED_CLASSPATH_BUGFIX = 0x2000; + private abstract class CompareResult implements Comparable { + final String fileName; + final String reportName; + + protected CompareResult(String fileName, String reportName) { + this.fileName = fileName; + this.reportName = reportName; + } + + abstract void reportResult(PrintWriter pw); + + @Override + public int compareTo(Object o) { + return this.fileName.compareTo(((CompareResult)o).fileName); + } + } + + private class VmSpecificResult extends CompareResult { + private VmSpecificResult(String fileName, String reportName) { + super(fileName, reportName); + } + + @Override + void reportResult(PrintWriter out) { + reportVmSpecific(out, reportName, "vm-specific"); + } + } + + private class MissingResult extends CompareResult { + final String type; + final Flags flags; + private MissingResult(String fileName, String reportName, String type, Flags flags) { + super(fileName, reportName); + this.type = type; + this.flags = flags; + } + + @Override + void reportResult(PrintWriter out) { + reportMissing(out, reportName, type, flags); + } + } + + private class NeedsMergeResult extends CompareResult { + final Flags flags; + final String target; + final String diffFile; + private NeedsMergeResult(String fileName, String reportName, String target, String diffFile, Flags flags) { + super(fileName, reportName); + this.target = target; + this.diffFile = diffFile; + this.flags = flags; + } + + @Override + void reportResult(PrintWriter out) { + reportNeedsMerge(out, reportName, target, diffFile, flags.mask(FLAGS_MASK)); + } + } + + private class ClasspathBugsResult extends CompareResult { + final Flags flags; + final String target; + private ClasspathBugsResult(String fileName, String reportName, String target, Flags flags) { + super(fileName, reportName); + this.target = target; + this.flags = flags; + } + + @Override + void reportResult(PrintWriter out) { + reportClasspathBugs(out, reportName, target, flags); + } + } + + private class CounterResult extends CompareResult { + final String counter; + private CounterResult(String fileName, String counter) { + super(fileName, ""); + this.counter = counter; + } + + @Override + void reportResult(PrintWriter out) { + //do nothing + } + } + public void execute() { if (destDir == null) throw new BuildException("The destdir attribute must be set"); @@ -97,13 +197,11 @@ if (type == null) throw new BuildException("The type attribute must be set"); + log("Comparing files"); - final Map<String, SourceFile> vmFiles = vmDirs - .scanJavaFiles(getProject()); - final Map<String, SourceFile> classpathFiles = classpathDirs - .scanJavaFiles(getProject()); - final Map<String, SourceFile> vmSpecificFiles = vmSpecificDirs - .scanJavaFiles(getProject()); + final Map<String, SourceFile> vmFiles = vmDirs.scanJavaFiles(getProject()); + final Map<String, SourceFile> classpathFiles = classpathDirs.scanJavaFiles(getProject()); + final Map<String, SourceFile> vmSpecificFiles = vmSpecificDirs.scanJavaFiles(getProject()); final TreeSet<String> allFiles = new TreeSet<String>(); final Map<String, String> packageDiffs = new TreeMap<String, String>(); allFiles.addAll(vmFiles.keySet()); @@ -111,6 +209,108 @@ try { destDir.mkdirs(); + + int n = Runtime.getRuntime().availableProcessors() * 2; + + ExecutorService es = Executors.newFixedThreadPool(n); + + class CompareCallable implements Callable<Collection<CompareResult>> { + private Collection<String> files; + + CompareCallable(Collection<String> files) { + this.files = files; + } + + @Override + public Collection<CompareResult> call() throws Exception { + ArrayList<CompareResult> results = new ArrayList<CompareResult>(); + for (String name : files) { + SourceFile cpFile = classpathFiles.get(name); + final SourceFile vmFile = vmFiles.get(name); + final SourceFile vmSpecificFile = vmSpecificFiles.get(name); + + if (vmSpecificFile != null) { + // File is found as vm specific source + results.add(new VmSpecificResult(name, vmSpecificFile.getReportName())); + } else if (vmFile == null) { + // file is not found as vmspecific source, nor as vm source + if (!cpFile.isIgnoreMissing()) { + results.add(new MissingResult(name, cpFile.getReportName(), type, getFlags(cpFile))); + } + } else if (cpFile == null) { + // File is not found in classpath sources + results.add(new MissingResult(name, vmFile.getReportName(), "vm", new Flags())); + } else { + // We have both the classpath version and the vm version. + cpFile = cpFile.getBestFileForTarget(vmFile.getTarget()); + // Let's compare them + final String diffFileName = vmFile.getReportName() + ".diff"; + Flags rc = runDiff(vmFile, cpFile, diffFileName, packageDiffs); + switch (rc.asInt() & ~FLAGS_MASK) { + case NO_CHANGE: + break; + case NEEDS_MERGE: + results.add(new NeedsMergeResult(name, vmFile.getReportName(), vmFile.getTarget(), diffFileName, rc.mask(FLAGS_MASK))); + break; + default: + throw new RuntimeException("Invalid rc " + rc); + } + if (rc.isSet(FLAG_VM_SPECIFIC)) { + results.add(new CounterResult(name, "FLAG_VM_SPECIFIC")); + } + if (rc.isSet(FLAG_CLASSPATH_BUGFIX)) { + results.add(new CounterResult(name, "FLAG_CLASSPATH_BUGFIX")); + } + if (rc.isSet(FLAG_NATIVE)) { + results.add(new CounterResult(name, "FLAG_NATIVE")); + } + if (rc.isSet(FLAG_JNODE)) { + results.add(new CounterResult(name, "FLAG_JNODE")); + } + + if (rc.getBugIDs().length > 0) { + results.add(new ClasspathBugsResult(name, vmFile.getReportName(), vmFile.getTarget(), rc)); + } + } + } + return results; + } + } + + + ArrayList<String> al = new ArrayList<String>(); + al.addAll(allFiles); + + CompareCallable[] tasks = new CompareCallable[n]; + + for(int i = 0; i < n; i++) { + tasks[i] = new CompareCallable(al.subList(i * al.size() / n, (i + 1) * al.size() / n)); + } + + List<Future<Collection<CompareResult>>> futures = es.invokeAll(Arrays.asList(tasks)); + + es.shutdown(); + es.awaitTermination(1, TimeUnit.HOURS); + + ArrayList<CompareResult> results = new ArrayList<CompareResult>(); + + for(Future<Collection<CompareResult>> future : futures){ + if(future.isDone()) { + try { + results.addAll(future.get()); + } catch (ExecutionException x) { + throw new RuntimeException(x); + } + } else { + throw new RuntimeException("Future is not done: " + future); + } + + } + + Collections.sort(results); + + log("Generating reports"); + final File outBugsFile = new File(destDir, "bugfix.html"); final PrintWriter outBugs = new PrintWriter(new FileWriter(outBugsFile)); reportHeader(outBugs, "Class", "Target", "Classpath bugs"); @@ -128,61 +328,36 @@ int diffJNode = 0; int vmSpecific = 0; - for (String name : allFiles) { - SourceFile cpFile = classpathFiles.get(name); - final SourceFile vmFile = vmFiles.get(name); - final SourceFile vmSpecificFile = vmSpecificFiles - .get(name); - - if (vmSpecificFile != null) { - // File is found as vm specific source - reportVmSpecific(out, vmSpecificFile.getReportName(), - "vm-specific"); + for (CompareResult result : results) { + if (result instanceof VmSpecificResult) { + result.reportResult(out); vmSpecific++; - } else if (vmFile == null) { - // file is not found as vmspecific source, nor as vm source - if (!cpFile.isIgnoreMissing()) { - reportMissing(out, cpFile.getReportName(), type, - getFlags(cpFile)); + } else if (result instanceof MissingResult) { + result.reportResult(out); + MissingResult missingResult = (MissingResult) result; + if(missingResult.type.equals("vm")) { + missingInCp++; + } else { missingInVm++; } - } else if (cpFile == null) { - // File is not found in classpath sources - reportMissing(out, vmFile.getReportName(), "vm", new Flags()); - missingInCp++; - } else { - // We have both the classpath version and the vm version. - cpFile = cpFile.getBestFileForTarget(vmFile.getTarget()); - - // Let's compare them - final String diffFileName = vmFile.getReportName() + ".diff"; - Flags rc = runDiff(vmFile, cpFile, diffFileName, packageDiffs); - switch (rc.asInt() & ~FLAGS_MASK) { - case NO_CHANGE: - break; - case NEEDS_MERGE: - reportNeedsMerge(out, vmFile.getReportName(), vmFile - .getTarget(), diffFileName, rc.mask(FLAGS_MASK)); - needsMerge++; - break; - default: - throw new RuntimeException("Invalid rc " + rc); - } - if (rc.isSet(FLAG_VM_SPECIFIC)) { + } else if (result instanceof NeedsMergeResult) { + result.reportResult(out); + needsMerge++; + } else if (result instanceof CounterResult) { + CounterResult counterResult = (CounterResult) result; + if (counterResult.counter.equals("FLAG_VM_SPECIFIC")) { diffVmSpecific++; - } - if (rc.isSet(FLAG_CLASSPATH_BUGFIX)) { + } else if (counterResult.counter.equals("FLAG_CLASSPATH_BUGFIX")) { diffClasspathBugfix++; - } - if (rc.isSet(FLAG_NATIVE)) { + } else if (counterResult.counter.equals("FLAG_NATIVE")) { diffNative++; - } - if (rc.isSet(FLAG_JNODE)) { + } else if (counterResult.counter.equals("FLAG_JNODE")) { diffJNode++; } - - reportClasspathBugs(outBugs, vmFile.getReportName(), vmFile - .getTarget(), rc); + } else if(result instanceof ClasspathBugsResult) { + result.reportResult(outBugs); + } else { + new RuntimeException("Unknown compare result: " + result); } } @@ -200,23 +375,19 @@ // Summary out.println("<a name='summary'/><h2>Summary</h2>"); if (missingInCp > 0) { - out.println("Found " + missingInCp - + " files missing in " + type + "</br>"); + out.println("Found " + missingInCp + " files missing in " + type + "</br>"); log("Found " + missingInCp + " files missing in " + type); } if (missingInVm > 0) { - out.println("Found " + missingInVm - + " files missing in vm<br/>"); + out.println("Found " + missingInVm + " files missing in vm<br/>"); log("Found " + missingInVm + " files missing in vm"); } if (needsMerge > 0) { - out.println("Found " + needsMerge - + " files that needs merging<br/>"); + out.println("Found " + needsMerge + " files that needs merging<br/>"); log("Found " + needsMerge + " files that needs merging"); } if (diffVmSpecific > 0) { - out.println("Found " + diffVmSpecific - + " VM specific differences<br/>"); + out.println("Found " + diffVmSpecific + " VM specific differences<br/>"); log("Found " + diffVmSpecific + " VM specific differences"); } if (vmSpecific > 0) { @@ -224,19 +395,16 @@ log("Found " + vmSpecific + " VM specific files"); } if (diffClasspathBugfix > 0) { - out.println("Found " + diffClasspathBugfix - + " local <a href=\"bugfix.html\">classpath bugfixes</a><br/>"); - log("Found " + diffClasspathBugfix - + " local classpath bugfixes"); + out.println("Found " + diffClasspathBugfix + + " local <a href=\"bugfix.html\">classpath bugfixes</a><br/>"); + log("Found " + diffClasspathBugfix + " local classpath bugfixes"); } if (diffNative > 0) { - out.println("Found " + diffNative - + " changes with native in it<br/>"); + out.println("Found " + diffNative + " changes with native in it<br/>"); log("Found " + diffNative + " changes with native in it"); } if (diffJNode > 0) { - out.println("Found " + diffJNode - + " changes with JNode in it<br/>"); + out.println("Found " + diffJNode + " changes with JNode in it<br/>"); log("Found " + diffJNode + " changes with JNode in it"); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2011-07-15 18:38:57
|
Revision: 5832 http://jnode.svn.sourceforge.net/jnode/?rev=5832&view=rev Author: lsantha Date: 2011-07-15 18:38:45 +0000 (Fri, 15 Jul 2011) Log Message: ----------- Integrating OpenJDK 6 build 23. Modified Paths: -------------- classlib6/core/src/openjdk/com/com/sun/imageio/plugins/png/PNGImageReader.java classlib6/core/src/openjdk/com/com/sun/imageio/plugins/png/PNGImageWriter.java classlib6/core/src/openjdk/com/com/sun/imageio/plugins/png/PNGMetadata.java classlib6/core/src/openjdk/com/com/sun/org/apache/bcel/internal/classfile/Utility.java classlib6/core/src/openjdk/java/java/awt/AWTEvent.java classlib6/core/src/openjdk/java/java/awt/EventDispatchThread.java classlib6/core/src/openjdk/java/java/awt/MenuComponent.java classlib6/core/src/openjdk/java/java/awt/TrayIcon.java classlib6/core/src/openjdk/java/java/net/AbstractPlainDatagramSocketImpl.java classlib6/core/src/openjdk/java/java/net/AbstractPlainSocketImpl.java classlib6/core/src/openjdk/java/java/security/SignedObject.java classlib6/core/src/openjdk/java/java/sql/Timestamp.java classlib6/core/src/openjdk/javax/javax/swing/ImageIcon.java classlib6/core/src/openjdk/javax/javax/swing/Timer.java classlib6/core/src/openjdk/javax/javax/swing/TransferHandler.java classlib6/core/src/openjdk/javax/javax/xml/parsers/FactoryConfigurationError.java classlib6/core/src/openjdk/javax/javax/xml/stream/FactoryConfigurationError.java classlib6/core/src/openjdk/javax/javax/xml/transform/TransformerFactoryConfigurationError.java classlib6/core/src/openjdk/jaxws/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnection.java classlib6/core/src/openjdk/langtools/com/sun/tools/javac/code/Types.java classlib6/core/src/openjdk/langtools/com/sun/tools/javac/file/JavacFileManager.java classlib6/core/src/openjdk/langtools/com/sun/tools/javac/file/Paths.java classlib6/core/src/openjdk/sun/sun/font/FileFont.java classlib6/core/src/openjdk/sun/sun/font/TrueTypeFont.java classlib6/core/src/openjdk/sun/sun/font/Type1Font.java classlib6/core/src/openjdk/sun/sun/java2d/pipe/DrawImage.java classlib6/core/src/openjdk/sun/sun/misc/FloatingDecimal.java classlib6/core/src/openjdk/sun/sun/misc/SharedSecrets.java classlib6/core/src/openjdk/sun/sun/nio/ch/DatagramChannelImpl.java classlib6/core/src/openjdk/sun/sun/nio/ch/Net.java classlib6/core/src/openjdk/sun/sun/security/jgss/spi/GSSContextSpi.java classlib6/core/src/openjdk/sun/sun/security/provider/SeedGenerator.java classlib6/core/src/openjdk/sun/sun/security/validator/EndEntityChecker.java classlib6/core/src/openjdk/sun/sun/swing/table/DefaultTableCellHeaderRenderer.java classlib6/core/src/openjdk/svm/sun/security/provider/NativeSeedGenerator.java Added Paths: ----------- classlib6/core/src/icedtea/java/nio/ classlib6/core/src/icedtea/java/nio/channels/ classlib6/core/src/icedtea/java/nio/channels/AlreadyConnectedException.java classlib6/core/src/icedtea/java/nio/channels/AsynchronousCloseException.java classlib6/core/src/icedtea/java/nio/channels/CancelledKeyException.java classlib6/core/src/icedtea/java/nio/channels/ClosedByInterruptException.java classlib6/core/src/icedtea/java/nio/channels/ClosedChannelException.java classlib6/core/src/icedtea/java/nio/channels/ClosedSelectorException.java classlib6/core/src/icedtea/java/nio/channels/ConnectionPendingException.java classlib6/core/src/icedtea/java/nio/channels/FileLockInterruptionException.java classlib6/core/src/icedtea/java/nio/channels/IllegalBlockingModeException.java classlib6/core/src/icedtea/java/nio/channels/IllegalSelectorException.java classlib6/core/src/icedtea/java/nio/channels/NoConnectionPendingException.java classlib6/core/src/icedtea/java/nio/channels/NonReadableChannelException.java classlib6/core/src/icedtea/java/nio/channels/NonWritableChannelException.java classlib6/core/src/icedtea/java/nio/channels/NotYetBoundException.java classlib6/core/src/icedtea/java/nio/channels/NotYetConnectedException.java classlib6/core/src/icedtea/java/nio/channels/OverlappingFileLockException.java classlib6/core/src/icedtea/java/nio/channels/UnresolvedAddressException.java classlib6/core/src/icedtea/java/nio/channels/UnsupportedAddressTypeException.java classlib6/core/src/icedtea/java/nio/charset/ classlib6/core/src/icedtea/java/nio/charset/CharacterCodingException.java classlib6/core/src/icedtea/java/nio/charset/CharsetDecoder.java classlib6/core/src/icedtea/java/nio/charset/CharsetEncoder.java classlib6/core/src/icedtea/java/nio/charset/IllegalCharsetNameException.java classlib6/core/src/icedtea/java/nio/charset/UnsupportedCharsetException.java classlib6/core/src/openjdk/javax/javax/imageio/IIOException.java classlib6/core/src/openjdk/javax/javax/imageio/IIOImage.java classlib6/core/src/openjdk/javax/javax/imageio/IIOParamController.java classlib6/core/src/openjdk/javax/javax/imageio/ImageTranscoder.java classlib6/core/src/openjdk/javax/javax/imageio/package.html classlib6/core/src/openjdk/javax/javax/imageio/spi/ classlib6/core/src/openjdk/javax/javax/imageio/spi/DigraphNode.java classlib6/core/src/openjdk/javax/javax/imageio/spi/IIOServiceProvider.java classlib6/core/src/openjdk/javax/javax/imageio/spi/ImageInputStreamSpi.java classlib6/core/src/openjdk/javax/javax/imageio/spi/ImageOutputStreamSpi.java classlib6/core/src/openjdk/javax/javax/imageio/spi/ImageReaderSpi.java classlib6/core/src/openjdk/javax/javax/imageio/spi/ImageReaderWriterSpi.java classlib6/core/src/openjdk/javax/javax/imageio/spi/ImageTranscoderSpi.java classlib6/core/src/openjdk/javax/javax/imageio/spi/ImageWriterSpi.java classlib6/core/src/openjdk/javax/javax/imageio/spi/PartiallyOrderedSet.java classlib6/core/src/openjdk/javax/javax/imageio/spi/RegisterableService.java classlib6/core/src/openjdk/javax/javax/imageio/spi/package.html Removed Paths: ------------- classlib6/core/src/classpath/java/java/nio/channels/AlreadyConnectedException.java classlib6/core/src/classpath/java/java/nio/channels/AsynchronousCloseException.java classlib6/core/src/classpath/java/java/nio/channels/CancelledKeyException.java classlib6/core/src/classpath/java/java/nio/channels/ClosedByInterruptException.java classlib6/core/src/classpath/java/java/nio/channels/ClosedChannelException.java classlib6/core/src/classpath/java/java/nio/channels/ClosedSelectorException.java classlib6/core/src/classpath/java/java/nio/channels/ConnectionPendingException.java classlib6/core/src/classpath/java/java/nio/channels/FileLockInterruptionException.java classlib6/core/src/classpath/java/java/nio/channels/IllegalBlockingModeException.java classlib6/core/src/classpath/java/java/nio/channels/IllegalSelectorException.java classlib6/core/src/classpath/java/java/nio/channels/NoConnectionPendingException.java classlib6/core/src/classpath/java/java/nio/channels/NonReadableChannelException.java classlib6/core/src/classpath/java/java/nio/channels/NonWritableChannelException.java classlib6/core/src/classpath/java/java/nio/channels/NotYetBoundException.java classlib6/core/src/classpath/java/java/nio/channels/NotYetConnectedException.java classlib6/core/src/classpath/java/java/nio/channels/OverlappingFileLockException.java classlib6/core/src/classpath/java/java/nio/channels/UnresolvedAddressException.java classlib6/core/src/classpath/java/java/nio/channels/UnsupportedAddressTypeException.java classlib6/core/src/classpath/java/java/nio/charset/ classlib6/core/src/classpath/javax/javax/imageio/IIOException.java classlib6/core/src/classpath/javax/javax/imageio/IIOImage.java classlib6/core/src/classpath/javax/javax/imageio/IIOParamController.java classlib6/core/src/classpath/javax/javax/imageio/ImageTranscoder.java classlib6/core/src/classpath/javax/javax/imageio/package.html classlib6/core/src/classpath/javax/javax/imageio/spi/IIOServiceProvider.java classlib6/core/src/classpath/javax/javax/imageio/spi/ImageInputStreamSpi.java classlib6/core/src/classpath/javax/javax/imageio/spi/ImageOutputStreamSpi.java classlib6/core/src/classpath/javax/javax/imageio/spi/ImageReaderSpi.java classlib6/core/src/classpath/javax/javax/imageio/spi/ImageReaderWriterSpi.java classlib6/core/src/classpath/javax/javax/imageio/spi/ImageTranscoderSpi.java classlib6/core/src/classpath/javax/javax/imageio/spi/ImageWriterSpi.java classlib6/core/src/classpath/javax/javax/imageio/spi/RegisterableService.java classlib6/core/src/classpath/javax/javax/imageio/spi/package.html Deleted: classlib6/core/src/classpath/java/java/nio/channels/AlreadyConnectedException.java =================================================================== --- classlib6/core/src/classpath/java/java/nio/channels/AlreadyConnectedException.java 2011-07-15 18:06:22 UTC (rev 5831) +++ classlib6/core/src/classpath/java/java/nio/channels/AlreadyConnectedException.java 2011-07-15 18:38:45 UTC (rev 5832) @@ -1,50 +0,0 @@ -/* AlreadyConnectedException.java -- - Copyright (C) 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package java.nio.channels; - -public class AlreadyConnectedException extends IllegalStateException -{ - private static final long serialVersionUID = - 7331895245053773357L; - - /** - * Creates the exception - */ - public AlreadyConnectedException() - { - } -} Deleted: classlib6/core/src/classpath/java/java/nio/channels/AsynchronousCloseException.java =================================================================== --- classlib6/core/src/classpath/java/java/nio/channels/AsynchronousCloseException.java 2011-07-15 18:06:22 UTC (rev 5831) +++ classlib6/core/src/classpath/java/java/nio/channels/AsynchronousCloseException.java 2011-07-15 18:38:45 UTC (rev 5832) @@ -1,55 +0,0 @@ -/* AsynchronousCloseException.java -- - Copyright (C) 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package java.nio.channels; - - -/** - * @author Michael Koch - * @since 1.4 - */ -public class AsynchronousCloseException extends ClosedChannelException -{ - private static final long serialVersionUID = 6891178312432313966L; - - /** - * Creates the exception - */ - public AsynchronousCloseException() - { - } -} Deleted: classlib6/core/src/classpath/java/java/nio/channels/CancelledKeyException.java =================================================================== --- classlib6/core/src/classpath/java/java/nio/channels/CancelledKeyException.java 2011-07-15 18:06:22 UTC (rev 5831) +++ classlib6/core/src/classpath/java/java/nio/channels/CancelledKeyException.java 2011-07-15 18:38:45 UTC (rev 5832) @@ -1,55 +0,0 @@ -/* CancelledKeyException.java -- - Copyright (C) 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package java.nio.channels; - - -/** - * @author Michael Koch - * @since 1.4 - */ -public class CancelledKeyException extends IllegalStateException -{ - private static final long serialVersionUID = - 8438032138028814268L; - - /** - * Creates the exception - */ - public CancelledKeyException() - { - } -} Deleted: classlib6/core/src/classpath/java/java/nio/channels/ClosedByInterruptException.java =================================================================== --- classlib6/core/src/classpath/java/java/nio/channels/ClosedByInterruptException.java 2011-07-15 18:06:22 UTC (rev 5831) +++ classlib6/core/src/classpath/java/java/nio/channels/ClosedByInterruptException.java 2011-07-15 18:38:45 UTC (rev 5832) @@ -1,55 +0,0 @@ -/* ClosedByInterruptException.java -- - Copyright (C) 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package java.nio.channels; - - -/** - * @author Michael Koch - * @since 1.4 - */ -public class ClosedByInterruptException extends AsynchronousCloseException -{ - private static final long serialVersionUID = - 4488191543534286750L; - - /** - * Creates the exception - */ - public ClosedByInterruptException() - { - } -} Deleted: classlib6/core/src/classpath/java/java/nio/channels/ClosedChannelException.java =================================================================== --- classlib6/core/src/classpath/java/java/nio/channels/ClosedChannelException.java 2011-07-15 18:06:22 UTC (rev 5831) +++ classlib6/core/src/classpath/java/java/nio/channels/ClosedChannelException.java 2011-07-15 18:38:45 UTC (rev 5832) @@ -1,57 +0,0 @@ -/* ClosedChannelException.java -- - Copyright (C) 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package java.nio.channels; - -import java.io.IOException; - - -/** - * @author Michael Koch - * @since 1.4 - */ -public class ClosedChannelException extends IOException -{ - private static final long serialVersionUID = 882777185433553857L; - - /** - * Creates the exception - */ - public ClosedChannelException() - { - } -} Deleted: classlib6/core/src/classpath/java/java/nio/channels/ClosedSelectorException.java =================================================================== --- classlib6/core/src/classpath/java/java/nio/channels/ClosedSelectorException.java 2011-07-15 18:06:22 UTC (rev 5831) +++ classlib6/core/src/classpath/java/java/nio/channels/ClosedSelectorException.java 2011-07-15 18:38:45 UTC (rev 5832) @@ -1,55 +0,0 @@ -/* ClosedSelectorException.java -- - Copyright (C) 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package java.nio.channels; - - -/** - * @author Michael Koch - * @since 1.4 - */ -public class ClosedSelectorException extends IllegalStateException -{ - private static final long serialVersionUID = 6466297122317847835L; - - /** - * Creates the exception - */ - public ClosedSelectorException() - { - } -} Deleted: classlib6/core/src/classpath/java/java/nio/channels/ConnectionPendingException.java =================================================================== --- classlib6/core/src/classpath/java/java/nio/channels/ConnectionPendingException.java 2011-07-15 18:06:22 UTC (rev 5831) +++ classlib6/core/src/classpath/java/java/nio/channels/ConnectionPendingException.java 2011-07-15 18:38:45 UTC (rev 5832) @@ -1,55 +0,0 @@ -/* ConnectionPendingException.java -- - Copyright (C) 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package java.nio.channels; - - -/** - * @author Michael Koch - * @since 1.4 - */ -public class ConnectionPendingException extends IllegalStateException -{ - private static final long serialVersionUID = 2008393366501760879L; - - /** - * Creates the exception - */ - public ConnectionPendingException() - { - } -} Deleted: classlib6/core/src/classpath/java/java/nio/channels/FileLockInterruptionException.java =================================================================== --- classlib6/core/src/classpath/java/java/nio/channels/FileLockInterruptionException.java 2011-07-15 18:06:22 UTC (rev 5831) +++ classlib6/core/src/classpath/java/java/nio/channels/FileLockInterruptionException.java 2011-07-15 18:38:45 UTC (rev 5832) @@ -1,57 +0,0 @@ -/* FileLockInterruptionException.java -- - Copyright (C) 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package java.nio.channels; - -import java.io.IOException; - - -/** - * @author Michael Koch - * @since 1.4 - */ -public class FileLockInterruptionException extends IOException -{ - private static final long serialVersionUID = 7104080643653532383L; - - /** - * Creates the exception - */ - public FileLockInterruptionException() - { - } -} Deleted: classlib6/core/src/classpath/java/java/nio/channels/IllegalBlockingModeException.java =================================================================== --- classlib6/core/src/classpath/java/java/nio/channels/IllegalBlockingModeException.java 2011-07-15 18:06:22 UTC (rev 5831) +++ classlib6/core/src/classpath/java/java/nio/channels/IllegalBlockingModeException.java 2011-07-15 18:38:45 UTC (rev 5832) @@ -1,59 +0,0 @@ -/* IllegalBlockingModeException.java -- - Copyright (C) 2002, 2005 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package java.nio.channels; - - -/** - * @author Michael Koch (kon...@gm...) - * @since 1.4 - * - * Written using JDK 1.4.1 Online API from Sun - * Status: JDK 1.4 complete - */ -public class IllegalBlockingModeException extends IllegalStateException -{ - private static final long serialVersionUID = - 3335774961855590474L; - - /** - * Creates the exception - */ - public IllegalBlockingModeException() - { - super(); - } -} Deleted: classlib6/core/src/classpath/java/java/nio/channels/IllegalSelectorException.java =================================================================== --- classlib6/core/src/classpath/java/java/nio/channels/IllegalSelectorException.java 2011-07-15 18:06:22 UTC (rev 5831) +++ classlib6/core/src/classpath/java/java/nio/channels/IllegalSelectorException.java 2011-07-15 18:38:45 UTC (rev 5832) @@ -1,55 +0,0 @@ -/* IllegalSelectorException.java -- - Copyright (C) 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package java.nio.channels; - - -/** - * @author Michael Koch - * @since 1.4 - */ -public class IllegalSelectorException extends IllegalArgumentException -{ - private static final long serialVersionUID = - 8406323347253320987L; - - /** - * Creates the exception - */ - public IllegalSelectorException() - { - } -} Deleted: classlib6/core/src/classpath/java/java/nio/channels/NoConnectionPendingException.java =================================================================== --- classlib6/core/src/classpath/java/java/nio/channels/NoConnectionPendingException.java 2011-07-15 18:06:22 UTC (rev 5831) +++ classlib6/core/src/classpath/java/java/nio/channels/NoConnectionPendingException.java 2011-07-15 18:38:45 UTC (rev 5832) @@ -1,55 +0,0 @@ -/* NoConnectionPendingException.java -- - Copyright (C) 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package java.nio.channels; - - -/** - * @author Michael Koch - * @since 1.4 - */ -public class NoConnectionPendingException extends IllegalStateException -{ - private static final long serialVersionUID = - 8296561183633134743L; - - /** - * Creates the exception - */ - public NoConnectionPendingException() - { - } -} Deleted: classlib6/core/src/classpath/java/java/nio/channels/NonReadableChannelException.java =================================================================== --- classlib6/core/src/classpath/java/java/nio/channels/NonReadableChannelException.java 2011-07-15 18:06:22 UTC (rev 5831) +++ classlib6/core/src/classpath/java/java/nio/channels/NonReadableChannelException.java 2011-07-15 18:38:45 UTC (rev 5832) @@ -1,55 +0,0 @@ -/* NonReadableChannelException.java -- - Copyright (C) 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package java.nio.channels; - - -/** - * @author Michael Koch - * @since 1.4 - */ -public class NonReadableChannelException extends IllegalStateException -{ - private static final long serialVersionUID = - 3200915679294993514L; - - /** - * Creates the exception - */ - public NonReadableChannelException() - { - } -} Deleted: classlib6/core/src/classpath/java/java/nio/channels/NonWritableChannelException.java =================================================================== --- classlib6/core/src/classpath/java/java/nio/channels/NonWritableChannelException.java 2011-07-15 18:06:22 UTC (rev 5831) +++ classlib6/core/src/classpath/java/java/nio/channels/NonWritableChannelException.java 2011-07-15 18:38:45 UTC (rev 5832) @@ -1,55 +0,0 @@ -/* NonWritableChannelException.java -- - Copyright (C) 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package java.nio.channels; - - -/** - * @author Michael Koch - * @since 1.4 - */ -public class NonWritableChannelException extends IllegalStateException -{ - private static final long serialVersionUID = - 7071230488279011621L; - - /** - * Creates the exception - */ - public NonWritableChannelException() - { - } -} Deleted: classlib6/core/src/classpath/java/java/nio/channels/NotYetBoundException.java =================================================================== --- classlib6/core/src/classpath/java/java/nio/channels/NotYetBoundException.java 2011-07-15 18:06:22 UTC (rev 5831) +++ classlib6/core/src/classpath/java/java/nio/channels/NotYetBoundException.java 2011-07-15 18:38:45 UTC (rev 5832) @@ -1,55 +0,0 @@ -/* NotYetBoundException.java -- - Copyright (C) 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package java.nio.channels; - - -/** - * @author Michael Koch - * @since 1.4 - */ -public class NotYetBoundException extends IllegalStateException -{ - private static final long serialVersionUID = 4640999303950202242L; - - /** - * Creates the exception - */ - public NotYetBoundException() - { - } -} Deleted: classlib6/core/src/classpath/java/java/nio/channels/NotYetConnectedException.java =================================================================== --- classlib6/core/src/classpath/java/java/nio/channels/NotYetConnectedException.java 2011-07-15 18:06:22 UTC (rev 5831) +++ classlib6/core/src/classpath/java/java/nio/channels/NotYetConnectedException.java 2011-07-15 18:38:45 UTC (rev 5832) @@ -1,55 +0,0 @@ -/* NotYetConnectedException.java -- - Copyright (C) 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package java.nio.channels; - - -/** - * @author Michael Koch - * @since 1.4 - */ -public class NotYetConnectedException extends IllegalStateException -{ - private static final long serialVersionUID = 4697316551909513464L; - - /** - * Creates the exception - */ - public NotYetConnectedException() - { - } -} Deleted: classlib6/core/src/classpath/java/java/nio/channels/OverlappingFileLockException.java =================================================================== --- classlib6/core/src/classpath/java/java/nio/channels/OverlappingFileLockException.java 2011-07-15 18:06:22 UTC (rev 5831) +++ classlib6/core/src/classpath/java/java/nio/channels/OverlappingFileLockException.java 2011-07-15 18:38:45 UTC (rev 5832) @@ -1,55 +0,0 @@ -/* OverlappingFileLockException.java -- - Copyright (C) 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package java.nio.channels; - - -/** - * @author Michael Koch - * @since 1.4 - */ -public class OverlappingFileLockException extends IllegalStateException -{ - private static final long serialVersionUID = 2047812138163068433L; - - /** - * Creates the exception - */ - public OverlappingFileLockException() - { - } -} Deleted: classlib6/core/src/classpath/java/java/nio/channels/UnresolvedAddressException.java =================================================================== --- classlib6/core/src/classpath/java/java/nio/channels/UnresolvedAddressException.java 2011-07-15 18:06:22 UTC (rev 5831) +++ classlib6/core/src/classpath/java/java/nio/channels/UnresolvedAddressException.java 2011-07-15 18:38:45 UTC (rev 5832) @@ -1,55 +0,0 @@ -/* UnresolvedAddressException.java -- - Copyright (C) 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package java.nio.channels; - - -/** - * @author Michael Koch - * @since 1.4 - */ -public class UnresolvedAddressException extends IllegalArgumentException -{ - private static final long serialVersionUID = 6136959093620794148L; - - /** - * Creates the exception - */ - public UnresolvedAddressException() - { - } -} Deleted: classlib6/core/src/classpath/java/java/nio/channels/UnsupportedAddressTypeException.java =================================================================== --- classlib6/core/src/classpath/java/java/nio/channels/UnsupportedAddressTypeException.java 2011-07-15 18:06:22 UTC (rev 5831) +++ classlib6/core/src/classpath/java/java/nio/channels/UnsupportedAddressTypeException.java 2011-07-15 18:38:45 UTC (rev 5832) @@ -1,55 +0,0 @@ -/* UnsupportedAddressTypeException.java -- - Copyright (C) 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package java.nio.channels; - - -/** - * @author Michael Koch - * @since 1.4 - */ -public class UnsupportedAddressTypeException extends IllegalArgumentException -{ - private static final long serialVersionUID = - 2964323842829700493L; - - /** - * Creates the exception - */ - public UnsupportedAddressTypeException() - { - } -} Deleted: classlib6/core/src/classpath/javax/javax/imageio/IIOException.java =================================================================== --- classlib6/core/src/classpath/javax/javax/imageio/IIOException.java 2011-07-15 18:06:22 UTC (rev 5831) +++ classlib6/core/src/classpath/javax/javax/imageio/IIOException.java 2011-07-15 18:38:45 UTC (rev 5832) @@ -1,70 +0,0 @@ -/* IIOException.java -- - Copyright (C) 2004, 2005 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package javax.imageio; - -import java.io.IOException; - -/** - * A runtime exception to indicate image reading and writing failures. - * - * @author Michael Koch (kon...@gm...) - */ -public class IIOException extends IOException -{ - /** - * Create an exception with a descriptive error message. - * - * @param message The descriptive error message. - */ - public IIOException(String message) - { - super(message); - } - - /** - * Create an exception with a descriptive error message. - * - * @param message The descriptive error message. - * @param cause The cause for this exception. - */ - public IIOException(String message, Throwable cause) - { - super(message); - initCause(cause); - } -} Deleted: classlib6/core/src/classpath/javax/javax/imageio/IIOImage.java =================================================================== --- classlib6/core/src/classpath/javax/javax/imageio/IIOImage.java 2011-07-15 18:06:22 UTC (rev 5831) +++ classlib6/core/src/classpath/javax/javax/imageio/IIOImage.java 2011-07-15 18:38:45 UTC (rev 5832) @@ -1,268 +0,0 @@ -/* IIOImage.java -- - Copyright (C) 2003 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -package javax.imageio; - -import java.awt.image.BufferedImage; -import java.awt.image.Raster; -import java.awt.image.RenderedImage; -import java.util.List; - -import javax.imageio.metadata.IIOMetadata; - -/** - * IIOImage is a container class for components of an image file that - * stores image data, image metadata and thumbnails. - * - * The image data can be either a RenderedImage or a Raster but not - * both. Image readers that produce IIOImages will always produce - * BufferedImages from the RenderedImage field. Image writers that - * accept IIOImages will always accept RenderedImages and may - * optionally accept Rasters. - * - * @author Thomas Fitzsimmons (fi...@re...) - */ -public class IIOImage -{ - /** - * Image data as a RenderedImage. null if this IIOImage uses the - * Raster representation. - */ - protected RenderedImage image; - - /** - * Image metadata. - */ - protected IIOMetadata metadata; - - /** - * Image data as a Raster. null if this IIOImage uses the - * RenderedImage representation. - */ - protected Raster raster; - - /** - * A list of BufferedImage thumbnails of this image. - */ - protected List<? extends Buffered... [truncated message content] |
From: <ls...@us...> - 2011-07-15 18:06:32
|
Revision: 5831 http://jnode.svn.sourceforge.net/jnode/?rev=5831&view=rev Author: lsantha Date: 2011-07-15 18:06:22 +0000 (Fri, 15 Jul 2011) Log Message: ----------- Integrating OpenJDK 6 build 23. Nimbus L&F. Added Paths: ----------- classlib6/core/src/icedtea/com/sun/java/ classlib6/core/src/icedtea/com/sun/java/swing/ classlib6/core/src/icedtea/com/sun/java/swing/plaf/ classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/ classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/ArrowButtonPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/ButtonPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/CheckBoxMenuItemPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/CheckBoxPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/ComboBoxArrowButtonEditableState.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/ComboBoxArrowButtonPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/ComboBoxEditableState.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/ComboBoxPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/ComboBoxTextFieldPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/DesktopIconPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/DesktopPanePainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/EditorPanePainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/FileChooserPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/FormattedTextFieldPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/InternalFramePainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/InternalFrameTitlePaneCloseButtonPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/InternalFrameTitlePaneCloseButtonWindowNotFocusedState.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/InternalFrameTitlePaneIconifyButtonPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/InternalFrameTitlePaneIconifyButtonWindowNotFocusedState.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/InternalFrameTitlePaneMaximizeButtonPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/InternalFrameTitlePaneMaximizeButtonWindowMaximizedState.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/InternalFrameTitlePaneMaximizeButtonWindowNotFocusedState.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/InternalFrameTitlePaneMenuButtonPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/InternalFrameTitlePaneMenuButtonWindowNotFocusedState.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/InternalFrameTitlePanePainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/InternalFrameTitlePaneWindowFocusedState.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/InternalFrameWindowFocusedState.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/MenuBarMenuPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/MenuBarPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/MenuItemPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/MenuPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/NimbusDefaults.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/OptionPaneMessageAreaOptionPaneLabelPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/OptionPaneMessageAreaPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/OptionPanePainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/PasswordFieldPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/PopupMenuPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/PopupMenuSeparatorPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/ProgressBarFinishedState.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/ProgressBarIndeterminateState.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/ProgressBarPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/RadioButtonMenuItemPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/RadioButtonPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/ScrollBarButtonPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/ScrollBarPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/ScrollBarThumbPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/ScrollBarTrackPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/ScrollPanePainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/SeparatorPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/SliderArrowShapeState.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/SliderPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/SliderThumbArrowShapeState.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/SliderThumbPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/SliderTrackArrowShapeState.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/SliderTrackPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/SpinnerNextButtonPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/SpinnerPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/SpinnerPanelSpinnerFormattedTextFieldPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/SpinnerPreviousButtonPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/SplitPaneDividerPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/SplitPaneDividerVerticalState.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/SplitPanePainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/SplitPaneVerticalState.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/TabbedPanePainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/TabbedPaneTabAreaPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/TabbedPaneTabPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/TableEditorPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/TableHeaderPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/TableHeaderRendererPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/TableHeaderRendererSortedState.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/TextAreaNotInScrollPaneState.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/TextAreaPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/TextFieldPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/TextPanePainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/ToggleButtonPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/ToolBarButtonPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/ToolBarEastState.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/ToolBarNorthState.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/ToolBarPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/ToolBarSouthState.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/ToolBarToggleButtonPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/ToolBarWestState.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/ToolTipPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/TreeCellEditorPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/TreeCellPainter.java classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/TreePainter.java classlib6/core/src/openjdk/com/com/sun/java/swing/plaf/nimbus/ classlib6/core/src/openjdk/com/com/sun/java/swing/plaf/nimbus/AbstractRegionPainter.java classlib6/core/src/openjdk/com/com/sun/java/swing/plaf/nimbus/Defaults.template classlib6/core/src/openjdk/com/com/sun/java/swing/plaf/nimbus/DerivedColor.java classlib6/core/src/openjdk/com/com/sun/java/swing/plaf/nimbus/DropShadowEffect.java classlib6/core/src/openjdk/com/com/sun/java/swing/plaf/nimbus/Effect.java classlib6/core/src/openjdk/com/com/sun/java/swing/plaf/nimbus/EffectUtils.java classlib6/core/src/openjdk/com/com/sun/java/swing/plaf/nimbus/ImageCache.java classlib6/core/src/openjdk/com/com/sun/java/swing/plaf/nimbus/ImageScalingHelper.java classlib6/core/src/openjdk/com/com/sun/java/swing/plaf/nimbus/InnerGlowEffect.java classlib6/core/src/openjdk/com/com/sun/java/swing/plaf/nimbus/InnerShadowEffect.java classlib6/core/src/openjdk/com/com/sun/java/swing/plaf/nimbus/LoweredBorder.java classlib6/core/src/openjdk/com/com/sun/java/swing/plaf/nimbus/NimbusIcon.java classlib6/core/src/openjdk/com/com/sun/java/swing/plaf/nimbus/NimbusLookAndFeel.java classlib6/core/src/openjdk/com/com/sun/java/swing/plaf/nimbus/NimbusStyle.java classlib6/core/src/openjdk/com/com/sun/java/swing/plaf/nimbus/OuterGlowEffect.java classlib6/core/src/openjdk/com/com/sun/java/swing/plaf/nimbus/PainterImpl.template classlib6/core/src/openjdk/com/com/sun/java/swing/plaf/nimbus/ShadowEffect.java classlib6/core/src/openjdk/com/com/sun/java/swing/plaf/nimbus/State.java classlib6/core/src/openjdk/com/com/sun/java/swing/plaf/nimbus/StateImpl.template classlib6/core/src/openjdk/com/com/sun/java/swing/plaf/nimbus/SynthPainterImpl.java classlib6/core/src/openjdk/com/com/sun/java/swing/plaf/nimbus/TableScrollPaneCorner.java classlib6/core/src/openjdk/com/com/sun/java/swing/plaf/nimbus/ToolBarSeparatorPainter.java classlib6/core/src/openjdk/com/com/sun/java/swing/plaf/nimbus/doc-files/ classlib6/core/src/openjdk/com/com/sun/java/swing/plaf/nimbus/doc-files/properties.html classlib6/core/src/openjdk/com/com/sun/java/swing/plaf/nimbus/package.html classlib6/core/src/openjdk/com/com/sun/java/swing/plaf/nimbus/skin.laf classlib6/core/src/openjdk/sun/sun/swing/plaf/GTKKeybindings.java classlib6/core/src/openjdk/sun/sun/swing/plaf/WindowsKeybindings.java Added: classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/ArrowButtonPainter.java =================================================================== --- classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/ArrowButtonPainter.java (rev 0) +++ classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/ArrowButtonPainter.java 2011-07-15 18:06:22 UTC (rev 5831) @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.sun.java.swing.plaf.nimbus; + +import com.sun.java.swing.Painter; + +import java.awt.*; +import java.awt.geom.*; +import java.awt.image.*; +import javax.swing.*; + + +final class ArrowButtonPainter extends AbstractRegionPainter { + //package private integers representing the available states that + //this painter will paint. These are used when creating a new instance + //of ArrowButtonPainter to determine which region/state is being painted + //by that instance. + static final int BACKGROUND_ENABLED = 1; + static final int FOREGROUND_DISABLED = 2; + static final int FOREGROUND_ENABLED = 3; + + + private int state; //refers to one of the static final ints above + private PaintContext ctx; + + //the following 4 variables are reused during the painting code of the layers + private Path2D path = new Path2D.Float(); + private Rectangle2D rect = new Rectangle2D.Float(0, 0, 0, 0); + private RoundRectangle2D roundRect = new RoundRectangle2D.Float(0, 0, 0, 0, 0, 0); + private Ellipse2D ellipse = new Ellipse2D.Float(0, 0, 0, 0); + + //All Colors used for painting are stored here. Ideally, only those colors being used + //by a particular instance of ArrowButtonPainter would be created. For the moment at least, + //however, all are created for each instance. + private Color color1 = decodeColor("nimbusBase", 0.027408898f, -0.57391655f, 0.1490196f, 0); + private Color color2 = decodeColor("nimbusBase", -0.57865167f, -0.6357143f, -0.37254906f, 0); + + + //Array of current component colors, updated in each paint call + private Object[] componentColors; + + public ArrowButtonPainter(PaintContext ctx, int state) { + super(); + this.state = state; + this.ctx = ctx; + } + + @Override + protected void doPaint(Graphics2D g, JComponent c, int width, int height, Object[] extendedCacheKeys) { + //populate componentColors array with colors calculated in getExtendedCacheKeys call + componentColors = extendedCacheKeys; + //generate this entire method. Each state/bg/fg/border combo that has + //been painted gets its own KEY and paint method. + switch(state) { + case FOREGROUND_DISABLED: paintForegroundDisabled(g); break; + case FOREGROUND_ENABLED: paintForegroundEnabled(g); break; + + } + } + + + + @Override + protected final PaintContext getPaintContext() { + return ctx; + } + + private void paintForegroundDisabled(Graphics2D g) { + path = decodePath1(); + g.setPaint(color1); + g.fill(path); + + } + + private void paintForegroundEnabled(Graphics2D g) { + path = decodePath1(); + g.setPaint(color2); + g.fill(path); + + } + + + + private Path2D decodePath1() { + path.reset(); + path.moveTo(decodeX(1.8f), decodeY(1.2f)); + path.lineTo(decodeX(1.2f), decodeY(1.5f)); + path.lineTo(decodeX(1.8f), decodeY(1.8f)); + path.lineTo(decodeX(1.8f), decodeY(1.2f)); + path.closePath(); + return path; + } + + + + +} Added: classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/ButtonPainter.java =================================================================== --- classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/ButtonPainter.java (rev 0) +++ classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/ButtonPainter.java 2011-07-15 18:06:22 UTC (rev 5831) @@ -0,0 +1,653 @@ +/* + * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.sun.java.swing.plaf.nimbus; + +import com.sun.java.swing.Painter; + +import java.awt.*; +import java.awt.geom.*; +import java.awt.image.*; +import javax.swing.*; + + +final class ButtonPainter extends AbstractRegionPainter { + //package private integers representing the available states that + //this painter will paint. These are used when creating a new instance + //of ButtonPainter to determine which region/state is being painted + //by that instance. + static final int BACKGROUND_DEFAULT = 1; + static final int BACKGROUND_DEFAULT_FOCUSED = 2; + static final int BACKGROUND_MOUSEOVER_DEFAULT = 3; + static final int BACKGROUND_MOUSEOVER_DEFAULT_FOCUSED = 4; + static final int BACKGROUND_PRESSED_DEFAULT = 5; + static final int BACKGROUND_PRESSED_DEFAULT_FOCUSED = 6; + static final int BACKGROUND_DISABLED = 7; + static final int BACKGROUND_ENABLED = 8; + static final int BACKGROUND_FOCUSED = 9; + static final int BACKGROUND_MOUSEOVER = 10; + static final int BACKGROUND_MOUSEOVER_FOCUSED = 11; + static final int BACKGROUND_PRESSED = 12; + static final int BACKGROUND_PRESSED_FOCUSED = 13; + + + private int state; //refers to one of the static final ints above + private PaintContext ctx; + + //the following 4 variables are reused during the painting code of the layers + private Path2D path = new Path2D.Float(); + private Rectangle2D rect = new Rectangle2D.Float(0, 0, 0, 0); + private RoundRectangle2D roundRect = new RoundRectangle2D.Float(0, 0, 0, 0, 0, 0); + private Ellipse2D ellipse = new Ellipse2D.Float(0, 0, 0, 0); + + //All Colors used for painting are stored here. Ideally, only those colors being used + //by a particular instance of ButtonPainter would be created. For the moment at least, + //however, all are created for each instance. + private Color color1 = decodeColor("nimbusBlueGrey", -0.027777791f, -0.06885965f, -0.36862746f, -190); + private Color color2 = decodeColor("nimbusBase", 5.1498413E-4f, -0.34585923f, -0.007843137f, 0); + private Color color3 = decodeColor("nimbusBase", 5.1498413E-4f, -0.095173776f, -0.25882354f, 0); + private Color color4 = decodeColor("nimbusBase", 0.004681647f, -0.6197143f, 0.43137252f, 0); + private Color color5 = decodeColor("nimbusBase", 0.004681647f, -0.5766426f, 0.38039213f, 0); + private Color color6 = decodeColor("nimbusBase", 5.1498413E-4f, -0.43866998f, 0.24705881f, 0); + private Color color7 = decodeColor("nimbusBase", 5.1498413E-4f, -0.46404046f, 0.36470586f, 0); + private Color color8 = decodeColor("nimbusBase", 5.1498413E-4f, -0.47761154f, 0.44313723f, 0); + private Color color9 = decodeColor("nimbusFocus", 0.0f, 0.0f, 0.0f, 0); + private Color color10 = decodeColor("nimbusBase", 0.0013483167f, -0.1769987f, -0.12156865f, 0); + private Color color11 = decodeColor("nimbusBase", 0.059279382f, 0.3642857f, -0.43529415f, 0); + private Color color12 = decodeColor("nimbusBase", 0.004681647f, -0.6198413f, 0.43921566f, 0); + private Color color13 = decodeColor("nimbusBase", -0.0017285943f, -0.5822163f, 0.40392154f, 0); + private Color color14 = decodeColor("nimbusBase", 5.1498413E-4f, -0.4555341f, 0.3215686f, 0); + private Color color15 = decodeColor("nimbusBase", 5.1498413E-4f, -0.47698414f, 0.43921566f, 0); + private Color color16 = decodeColor("nimbusBase", -0.06415892f, -0.5455182f, 0.45098037f, 0); + private Color color17 = decodeColor("nimbusBlueGrey", 0.0f, -0.110526316f, 0.25490195f, -95); + private Color color18 = decodeColor("nimbusBase", -0.57865167f, -0.6357143f, -0.54901963f, 0); + private Color color19 = decodeColor("nimbusBase", -3.528595E-5f, 0.018606722f, -0.23137257f, 0); + private Color color20 = decodeColor("nimbusBase", -4.2033195E-4f, -0.38050595f, 0.20392156f, 0); + private Color color21 = decodeColor("nimbusBase", 0.001903832f, -0.29863563f, 0.1490196f, 0); + private Color color22 = decodeColor("nimbusBase", 0.0f, 0.0f, 0.0f, 0); + private Color color23 = decodeColor("nimbusBase", 0.0018727183f, -0.14126986f, 0.15686274f, 0); + private Color color24 = decodeColor("nimbusBase", 8.9377165E-4f, -0.20852983f, 0.2588235f, 0); + private Color color25 = decodeColor("nimbusBlueGrey", -0.027777791f, -0.06885965f, -0.36862746f, -232); + private Color color26 = decodeColor("nimbusBlueGrey", 0.0f, -0.06766917f, 0.07843137f, 0); + private Color color27 = decodeColor("nimbusBlueGrey", 0.0f, -0.06484103f, 0.027450979f, 0); + private Color color28 = decodeColor("nimbusBlueGrey", 0.0f, -0.08477524f, 0.16862744f, 0); + private Color color29 = decodeColor("nimbusBlueGrey", -0.015872955f, -0.080091536f, 0.15686274f, 0); + private Color color30 = decodeColor("nimbusBlueGrey", 0.0f, -0.07016757f, 0.12941176f, 0); + private Color color31 = decodeColor("nimbusBlueGrey", 0.0f, -0.07052632f, 0.1372549f, 0); + private Color color32 = decodeColor("nimbusBlueGrey", 0.0f, -0.070878744f, 0.14509803f, 0); + private Color color33 = decodeColor("nimbusBlueGrey", -0.055555522f, -0.05356429f, -0.12549019f, 0); + private Color color34 = decodeColor("nimbusBlueGrey", 0.0f, -0.0147816315f, -0.3764706f, 0); + private Color color35 = decodeColor("nimbusBlueGrey", 0.055555582f, -0.10655806f, 0.24313724f, 0); + private Color color36 = decodeColor("nimbusBlueGrey", 0.0f, -0.09823123f, 0.2117647f, 0); + private Color color37 = decodeColor("nimbusBlueGrey", 0.0f, -0.0749532f, 0.24705881f, 0); + private Color color38 = decodeColor("nimbusBlueGrey", 0.0f, -0.110526316f, 0.25490195f, 0); + private Color color39 = decodeColor("nimbusBlueGrey", 0.0f, -0.020974077f, -0.21960783f, 0); + private Color color40 = decodeColor("nimbusBlueGrey", 0.0f, 0.11169591f, -0.53333336f, 0); + private Color color41 = decodeColor("nimbusBlueGrey", 0.055555582f, -0.10658931f, 0.25098038f, 0); + private Color color42 = decodeColor("nimbusBlueGrey", 0.0f, -0.098526314f, 0.2352941f, 0); + private Color color43 = decodeColor("nimbusBlueGrey", 0.0f, -0.07333623f, 0.20392156f, 0); + private Color color44 = new Color(245, 250, 255, 160); + private Color color45 = decodeColor("nimbusBlueGrey", 0.055555582f, 0.8894737f, -0.7176471f, 0); + private Color color46 = decodeColor("nimbusBlueGrey", 0.0f, 5.847961E-4f, -0.32156864f, 0); + private Color color47 = decodeColor("nimbusBlueGrey", -0.00505054f, -0.05960039f, 0.10196078f, 0); + private Color color48 = decodeColor("nimbusBlueGrey", -0.008547008f, -0.04772438f, 0.06666666f, 0); + private Color color49 = decodeColor("nimbusBlueGrey", -0.0027777553f, -0.0018306673f, -0.02352941f, 0); + private Color color50 = decodeColor("nimbusBlueGrey", -0.0027777553f, -0.0212406f, 0.13333333f, 0); + private Color color51 = decodeColor("nimbusBlueGrey", 0.0055555105f, -0.030845039f, 0.23921567f, 0); + + + //Array of current component colors, updated in each paint call + private Object[] componentColors; + + public ButtonPainter(PaintContext ctx, int state) { + super(); + this.state = state; + this.ctx = ctx; + } + + @Override + protected void doPaint(Graphics2D g, JComponent c, int width, int height, Object[] extendedCacheKeys) { + //populate componentColors array with colors calculated in getExtendedCacheKeys call + componentColors = extendedCacheKeys; + //generate this entire method. Each state/bg/fg/border combo that has + //been painted gets its own KEY and paint method. + switch(state) { + case BACKGROUND_DEFAULT: paintBackgroundDefault(g); break; + case BACKGROUND_DEFAULT_FOCUSED: paintBackgroundDefaultAndFocused(g); break; + case BACKGROUND_MOUSEOVER_DEFAULT: paintBackgroundMouseOverAndDefault(g); break; + case BACKGROUND_MOUSEOVER_DEFAULT_FOCUSED: paintBackgroundMouseOverAndDefaultAndFocused(g); break; + case BACKGROUND_PRESSED_DEFAULT: paintBackgroundPressedAndDefault(g); break; + case BACKGROUND_PRESSED_DEFAULT_FOCUSED: paintBackgroundPressedAndDefaultAndFocused(g); break; + case BACKGROUND_DISABLED: paintBackgroundDisabled(g); break; + case BACKGROUND_ENABLED: paintBackgroundEnabled(g); break; + case BACKGROUND_FOCUSED: paintBackgroundFocused(g); break; + case BACKGROUND_MOUSEOVER: paintBackgroundMouseOver(g); break; + case BACKGROUND_MOUSEOVER_FOCUSED: paintBackgroundMouseOverAndFocused(g); break; + case BACKGROUND_PRESSED: paintBackgroundPressed(g); break; + case BACKGROUND_PRESSED_FOCUSED: paintBackgroundPressedAndFocused(g); break; + + } + } + + protected Object[] getExtendedCacheKeys(JComponent c) { + Object[] extendedCacheKeys = null; + switch(state) { + case BACKGROUND_DEFAULT: + extendedCacheKeys = new Object[] { + getComponentColor(c, "background", color4, -0.6197143f, 0.43137252f, 0), + getComponentColor(c, "background", color5, -0.5766426f, 0.38039213f, 0), + getComponentColor(c, "background", color6, -0.43866998f, 0.24705881f, 0), + getComponentColor(c, "background", color7, -0.46404046f, 0.36470586f, 0), + getComponentColor(c, "background", color8, -0.47761154f, 0.44313723f, 0)}; + break; + case BACKGROUND_DEFAULT_FOCUSED: + extendedCacheKeys = new Object[] { + getComponentColor(c, "background", color4, -0.6197143f, 0.43137252f, 0), + getComponentColor(c, "background", color5, -0.5766426f, 0.38039213f, 0), + getComponentColor(c, "background", color6, -0.43866998f, 0.24705881f, 0), + getComponentColor(c, "background", color7, -0.46404046f, 0.36470586f, 0), + getComponentColor(c, "background", color8, -0.47761154f, 0.44313723f, 0)}; + break; + case BACKGROUND_MOUSEOVER_DEFAULT: + extendedCacheKeys = new Object[] { + getComponentColor(c, "background", color12, -0.6198413f, 0.43921566f, 0), + getComponentColor(c, "background", color13, -0.5822163f, 0.40392154f, 0), + getComponentColor(c, "background", color14, -0.4555341f, 0.3215686f, 0), + getComponentColor(c, "background", color15, -0.47698414f, 0.43921566f, 0), + getComponentColor(c, "background", color16, -0.5455182f, 0.45098037f, 0)}; + break; + case BACKGROUND_MOUSEOVER_DEFAULT_FOCUSED: + extendedCacheKeys = new Object[] { + getComponentColor(c, "background", color12, -0.6198413f, 0.43921566f, 0), + getComponentColor(c, "background", color13, -0.5822163f, 0.40392154f, 0), + getComponentColor(c, "background", color14, -0.4555341f, 0.3215686f, 0), + getComponentColor(c, "background", color15, -0.47698414f, 0.43921566f, 0), + getComponentColor(c, "background", color16, -0.5455182f, 0.45098037f, 0)}; + break; + case BACKGROUND_PRESSED_DEFAULT: + extendedCacheKeys = new Object[] { + getComponentColor(c, "background", color20, -0.38050595f, 0.20392156f, 0), + getComponentColor(c, "background", color21, -0.29863563f, 0.1490196f, 0), + getComponentColor(c, "background", color22, 0.0f, 0.0f, 0), + getComponentColor(c, "background", color23, -0.14126986f, 0.15686274f, 0), + getComponentColor(c, "background", color24, -0.20852983f, 0.2588235f, 0)}; + break; + case BACKGROUND_PRESSED_DEFAULT_FOCUSED: + extendedCacheKeys = new Object[] { + getComponentColor(c, "background", color20, -0.38050595f, 0.20392156f, 0), + getComponentColor(c, "background", color21, -0.29863563f, 0.1490196f, 0), + getComponentColor(c, "background", color22, 0.0f, 0.0f, 0), + getComponentColor(c, "background", color23, -0.14126986f, 0.15686274f, 0), + getComponentColor(c, "background", color24, -0.20852983f, 0.2588235f, 0)}; + break; + case BACKGROUND_ENABLED: + extendedCacheKeys = new Object[] { + getComponentColor(c, "background", color35, -0.10655806f, 0.24313724f, 0), + getComponentColor(c, "background", color36, -0.09823123f, 0.2117647f, 0), + getComponentColor(c, "background", color30, -0.07016757f, 0.12941176f, 0), + getComponentColor(c, "background", color37, -0.0749532f, 0.24705881f, 0), + getComponentColor(c, "background", color38, -0.110526316f, 0.25490195f, 0)}; + break; + case BACKGROUND_FOCUSED: + extendedCacheKeys = new Object[] { + getComponentColor(c, "background", color35, -0.10655806f, 0.24313724f, 0), + getComponentColor(c, "background", color36, -0.09823123f, 0.2117647f, 0), + getComponentColor(c, "background", color30, -0.07016757f, 0.12941176f, 0), + getComponentColor(c, "background", color37, -0.0749532f, 0.24705881f, 0), + getComponentColor(c, "background", color38, -0.110526316f, 0.25490195f, 0)}; + break; + case BACKGROUND_MOUSEOVER: + extendedCacheKeys = new Object[] { + getComponentColor(c, "background", color41, -0.10658931f, 0.25098038f, 0), + getComponentColor(c, "background", color42, -0.098526314f, 0.2352941f, 0), + getComponentColor(c, "background", color43, -0.07333623f, 0.20392156f, 0), + getComponentColor(c, "background", color38, -0.110526316f, 0.25490195f, 0)}; + break; + case BACKGROUND_MOUSEOVER_FOCUSED: + extendedCacheKeys = new Object[] { + getComponentColor(c, "background", color41, -0.10658931f, 0.25098038f, 0), + getComponentColor(c, "background", color42, -0.098526314f, 0.2352941f, 0), + getComponentColor(c, "background", color43, -0.07333623f, 0.20392156f, 0), + getComponentColor(c, "background", color38, -0.110526316f, 0.25490195f, 0)}; + break; + case BACKGROUND_PRESSED: + extendedCacheKeys = new Object[] { + getComponentColor(c, "background", color47, -0.05960039f, 0.10196078f, 0), + getComponentColor(c, "background", color48, -0.04772438f, 0.06666666f, 0), + getComponentColor(c, "background", color49, -0.0018306673f, -0.02352941f, 0), + getComponentColor(c, "background", color50, -0.0212406f, 0.13333333f, 0), + getComponentColor(c, "background", color51, -0.030845039f, 0.23921567f, 0)}; + break; + case BACKGROUND_PRESSED_FOCUSED: + extendedCacheKeys = new Object[] { + getComponentColor(c, "background", color47, -0.05960039f, 0.10196078f, 0), + getComponentColor(c, "background", color48, -0.04772438f, 0.06666666f, 0), + getComponentColor(c, "background", color49, -0.0018306673f, -0.02352941f, 0), + getComponentColor(c, "background", color50, -0.0212406f, 0.13333333f, 0), + getComponentColor(c, "background", color51, -0.030845039f, 0.23921567f, 0)}; + break; + } + return extendedCacheKeys; + } + + @Override + protected final PaintContext getPaintContext() { + return ctx; + } + + private void paintBackgroundDefault(Graphics2D g) { + roundRect = decodeRoundRect1(); + g.setPaint(color1); + g.fill(roundRect); + roundRect = decodeRoundRect2(); + g.setPaint(decodeGradient1(roundRect)); + g.fill(roundRect); + roundRect = decodeRoundRect3(); + g.setPaint(decodeGradient2(roundRect)); + g.fill(roundRect); + + } + + private void paintBackgroundDefaultAndFocused(Graphics2D g) { + roundRect = decodeRoundRect4(); + g.setPaint(color9); + g.fill(roundRect); + roundRect = decodeRoundRect2(); + g.setPaint(decodeGradient1(roundRect)); + g.fill(roundRect); + roundRect = decodeRoundRect3(); + g.setPaint(decodeGradient2(roundRect)); + g.fill(roundRect); + + } + + private void paintBackgroundMouseOverAndDefault(Graphics2D g) { + roundRect = decodeRoundRect5(); + g.setPaint(color1); + g.fill(roundRect); + roundRect = decodeRoundRect2(); + g.setPaint(decodeGradient3(roundRect)); + g.fill(roundRect); + roundRect = decodeRoundRect3(); + g.setPaint(decodeGradient2(roundRect)); + g.fill(roundRect); + + } + + private void paintBackgroundMouseOverAndDefaultAndFocused(Graphics2D g) { + roundRect = decodeRoundRect4(); + g.setPaint(color9); + g.fill(roundRect); + roundRect = decodeRoundRect2(); + g.setPaint(decodeGradient3(roundRect)); + g.fill(roundRect); + roundRect = decodeRoundRect3(); + g.setPaint(decodeGradient2(roundRect)); + g.fill(roundRect); + + } + + private void paintBackgroundPressedAndDefault(Graphics2D g) { + roundRect = decodeRoundRect1(); + g.setPaint(color17); + g.fill(roundRect); + roundRect = decodeRoundRect2(); + g.setPaint(decodeGradient4(roundRect)); + g.fill(roundRect); + roundRect = decodeRoundRect3(); + g.setPaint(decodeGradient2(roundRect)); + g.fill(roundRect); + + } + + private void paintBackgroundPressedAndDefaultAndFocused(Graphics2D g) { + roundRect = decodeRoundRect4(); + g.setPaint(color9); + g.fill(roundRect); + roundRect = decodeRoundRect2(); + g.setPaint(decodeGradient4(roundRect)); + g.fill(roundRect); + roundRect = decodeRoundRect3(); + g.setPaint(decodeGradient2(roundRect)); + g.fill(roundRect); + + } + + private void paintBackgroundDisabled(Graphics2D g) { + roundRect = decodeRoundRect1(); + g.setPaint(color25); + g.fill(roundRect); + roundRect = decodeRoundRect2(); + g.setPaint(decodeGradient5(roundRect)); + g.fill(roundRect); + roundRect = decodeRoundRect3(); + g.setPaint(decodeGradient6(roundRect)); + g.fill(roundRect); + + } + + private void paintBackgroundEnabled(Graphics2D g) { + roundRect = decodeRoundRect1(); + g.setPaint(color1); + g.fill(roundRect); + roundRect = decodeRoundRect2(); + g.setPaint(decodeGradient7(roundRect)); + g.fill(roundRect); + roundRect = decodeRoundRect3(); + g.setPaint(decodeGradient2(roundRect)); + g.fill(roundRect); + + } + + private void paintBackgroundFocused(Graphics2D g) { + roundRect = decodeRoundRect4(); + g.setPaint(color9); + g.fill(roundRect); + roundRect = decodeRoundRect2(); + g.setPaint(decodeGradient7(roundRect)); + g.fill(roundRect); + roundRect = decodeRoundRect3(); + g.setPaint(decodeGradient8(roundRect)); + g.fill(roundRect); + + } + + private void paintBackgroundMouseOver(Graphics2D g) { + roundRect = decodeRoundRect1(); + g.setPaint(color1); + g.fill(roundRect); + roundRect = decodeRoundRect2(); + g.setPaint(decodeGradient9(roundRect)); + g.fill(roundRect); + roundRect = decodeRoundRect3(); + g.setPaint(decodeGradient10(roundRect)); + g.fill(roundRect); + + } + + private void paintBackgroundMouseOverAndFocused(Graphics2D g) { + roundRect = decodeRoundRect4(); + g.setPaint(color9); + g.fill(roundRect); + roundRect = decodeRoundRect2(); + g.setPaint(decodeGradient9(roundRect)); + g.fill(roundRect); + roundRect = decodeRoundRect3(); + g.setPaint(decodeGradient10(roundRect)); + g.fill(roundRect); + + } + + private void paintBackgroundPressed(Graphics2D g) { + roundRect = decodeRoundRect1(); + g.setPaint(color44); + g.fill(roundRect); + roundRect = decodeRoundRect2(); + g.setPaint(decodeGradient11(roundRect)); + g.fill(roundRect); + roundRect = decodeRoundRect3(); + g.setPaint(decodeGradient2(roundRect)); + g.fill(roundRect); + + } + + private void paintBackgroundPressedAndFocused(Graphics2D g) { + roundRect = decodeRoundRect4(); + g.setPaint(color9); + g.fill(roundRect); + roundRect = decodeRoundRect2(); + g.setPaint(decodeGradient11(roundRect)); + g.fill(roundRect); + roundRect = decodeRoundRect3(); + g.setPaint(decodeGradient2(roundRect)); + g.fill(roundRect); + + } + + + + private RoundRectangle2D decodeRoundRect1() { + roundRect.setRoundRect(decodeX(0.2857143f), //x + decodeY(0.42857143f), //y + decodeX(2.7142859f) - decodeX(0.2857143f), //width + decodeY(2.857143f) - decodeY(0.42857143f), //height + 12.0f, 12.0f); //rounding + return roundRect; + } + + private RoundRectangle2D decodeRoundRect2() { + roundRect.setRoundRect(decodeX(0.2857143f), //x + decodeY(0.2857143f), //y + decodeX(2.7142859f) - decodeX(0.2857143f), //width + decodeY(2.7142859f) - decodeY(0.2857143f), //height + 9.0f, 9.0f); //rounding + return roundRect; + } + + private RoundRectangle2D decodeRoundRect3() { + roundRect.setRoundRect(decodeX(0.42857143f), //x + decodeY(0.42857143f), //y + decodeX(2.5714285f) - decodeX(0.42857143f), //width + decodeY(2.5714285f) - decodeY(0.42857143f), //height + 7.0f, 7.0f); //rounding + return roundRect; + } + + private RoundRectangle2D decodeRoundRect4() { + roundRect.setRoundRect(decodeX(0.08571429f), //x + decodeY(0.08571429f), //y + decodeX(2.914286f) - decodeX(0.08571429f), //width + decodeY(2.914286f) - decodeY(0.08571429f), //height + 11.0f, 11.0f); //rounding + return roundRect; + } + + private RoundRectangle2D decodeRoundRect5() { + roundRect.setRoundRect(decodeX(0.2857143f), //x + decodeY(0.42857143f), //y + decodeX(2.7142859f) - decodeX(0.2857143f), //width + decodeY(2.857143f) - decodeY(0.42857143f), //height + 9.0f, 9.0f); //rounding + return roundRect; + } + + + + private Paint decodeGradient1(Shape s) { + Rectangle2D bounds = s.getBounds2D(); + float x = (float)bounds.getX(); + float y = (float)bounds.getY(); + float w = (float)bounds.getWidth(); + float h = (float)bounds.getHeight(); + return decodeGradient((0.5f * w) + x, (0.0f * h) + y, (0.5f * w) + x, (1.0f * h) + y, + new float[] { 0.05f,0.5f,0.95f }, + new Color[] { color2, + decodeColor(color2,color3,0.5f), + color3}); + } + + private Paint decodeGradient2(Shape s) { + Rectangle2D bounds = s.getBounds2D(); + float x = (float)bounds.getX(); + float y = (float)bounds.getY(); + float w = (float)bounds.getWidth(); + float h = (float)bounds.getHeight(); + return decodeGradient((0.5f * w) + x, (0.0f * h) + y, (0.5f * w) + x, (1.0f * h) + y, + new float[] { 0.0f,0.024f,0.06f,0.276f,0.6f,0.65f,0.7f,0.856f,0.96f,0.98399997f,1.0f }, + new Color[] { (Color)componentColors[0], + decodeColor((Color)componentColors[0],(Color)componentColors[1],0.5f), + (Color)componentColors[1], + decodeColor((Color)componentColors[1],(Color)componentColors[2],0.5f), + (Color)componentColors[2], + decodeColor((Color)componentColors[2],(Color)componentColors[2],0.5f), + (Color)componentColors[2], + decodeColor((Color)componentColors[2],(Color)componentColors[3],0.5f), + (Color)componentColors[3], + decodeColor((Color)componentColors[3],(Color)componentColors[4],0.5f), + (Color)componentColors[4]}); + } + + private Paint decodeGradient3(Shape s) { + Rectangle2D bounds = s.getBounds2D(); + float x = (float)bounds.getX(); + float y = (float)bounds.getY(); + float w = (float)bounds.getWidth(); + float h = (float)bounds.getHeight(); + return decodeGradient((0.5f * w) + x, (0.0f * h) + y, (0.5f * w) + x, (1.0f * h) + y, + new float[] { 0.05f,0.5f,0.95f }, + new Color[] { color10, + decodeColor(color10,color11,0.5f), + color11}); + } + + private Paint decodeGradient4(Shape s) { + Rectangle2D bounds = s.getBounds2D(); + float x = (float)bounds.getX(); + float y = (float)bounds.getY(); + float w = (float)bounds.getWidth(); + float h = (float)bounds.getHeight(); + return decodeGradient((0.5f * w) + x, (0.0f * h) + y, (0.5f * w) + x, (1.0f * h) + y, + new float[] { 0.05f,0.5f,0.95f }, + new Color[] { color18, + decodeColor(color18,color19,0.5f), + color19}); + } + + private Paint decodeGradient5(Shape s) { + Rectangle2D bounds = s.getBounds2D(); + float x = (float)bounds.getX(); + float y = (float)bounds.getY(); + float w = (float)bounds.getWidth(); + float h = (float)bounds.getHeight(); + return decodeGradient((0.5f * w) + x, (0.0f * h) + y, (0.5f * w) + x, (1.0f * h) + y, + new float[] { 0.09f,0.52f,0.95f }, + new Color[] { color26, + decodeColor(color26,color27,0.5f), + color27}); + } + + private Paint decodeGradient6(Shape s) { + Rectangle2D bounds = s.getBounds2D(); + float x = (float)bounds.getX(); + float y = (float)bounds.getY(); + float w = (float)bounds.getWidth(); + float h = (float)bounds.getHeight(); + return decodeGradient((0.5f * w) + x, (0.0f * h) + y, (0.5f * w) + x, (1.0f * h) + y, + new float[] { 0.0f,0.03f,0.06f,0.33f,0.6f,0.65f,0.7f,0.825f,0.95f,0.975f,1.0f }, + new Color[] { color28, + decodeColor(color28,color29,0.5f), + color29, + decodeColor(color29,color30,0.5f), + color30, + decodeColor(color30,color30,0.5f), + color30, + decodeColor(color30,color31,0.5f), + color31, + decodeColor(color31,color32,0.5f), + color32}); + } + + private Paint decodeGradient7(Shape s) { + Rectangle2D bounds = s.getBounds2D(); + float x = (float)bounds.getX(); + float y = (float)bounds.getY(); + float w = (float)bounds.getWidth(); + float h = (float)bounds.getHeight(); + return decodeGradient((0.5f * w) + x, (0.0f * h) + y, (0.5f * w) + x, (1.0f * h) + y, + new float[] { 0.09f,0.52f,0.95f }, + new Color[] { color33, + decodeColor(color33,color34,0.5f), + color34}); + } + + private Paint decodeGradient8(Shape s) { + Rectangle2D bounds = s.getBounds2D(); + float x = (float)bounds.getX(); + float y = (float)bounds.getY(); + float w = (float)bounds.getWidth(); + float h = (float)bounds.getHeight(); + return decodeGradient((0.5f * w) + x, (0.0f * h) + y, (0.5f * w) + x, (1.0f * h) + y, + new float[] { 0.0f,0.03f,0.06f,0.33f,0.6f,0.65f,0.7f,0.825f,0.95f,0.975f,1.0f }, + new Color[] { (Color)componentColors[0], + decodeColor((Color)componentColors[0],(Color)componentColors[1],0.5f), + (Color)componentColors[1], + decodeColor((Color)componentColors[1],(Color)componentColors[2],0.5f), + (Color)componentColors[2], + decodeColor((Color)componentColors[2],(Color)componentColors[2],0.5f), + (Color)componentColors[2], + decodeColor((Color)componentColors[2],(Color)componentColors[3],0.5f), + (Color)componentColors[3], + decodeColor((Color)componentColors[3],(Color)componentColors[4],0.5f), + (Color)componentColors[4]}); + } + + private Paint decodeGradient9(Shape s) { + Rectangle2D bounds = s.getBounds2D(); + float x = (float)bounds.getX(); + float y = (float)bounds.getY(); + float w = (float)bounds.getWidth(); + float h = (float)bounds.getHeight(); + return decodeGradient((0.5f * w) + x, (0.0f * h) + y, (0.5f * w) + x, (1.0f * h) + y, + new float[] { 0.09f,0.52f,0.95f }, + new Color[] { color39, + decodeColor(color39,color40,0.5f), + color40}); + } + + private Paint decodeGradient10(Shape s) { + Rectangle2D bounds = s.getBounds2D(); + float x = (float)bounds.getX(); + float y = (float)bounds.getY(); + float w = (float)bounds.getWidth(); + float h = (float)bounds.getHeight(); + return decodeGradient((0.5f * w) + x, (0.0f * h) + y, (0.5f * w) + x, (1.0f * h) + y, + new float[] { 0.0f,0.024f,0.06f,0.276f,0.6f,0.65f,0.7f,0.856f,0.96f,0.98f,1.0f }, + new Color[] { (Color)componentColors[0], + decodeColor((Color)componentColors[0],(Color)componentColors[1],0.5f), + (Color)componentColors[1], + decodeColor((Color)componentColors[1],(Color)componentColors[2],0.5f), + (Color)componentColors[2], + decodeColor((Color)componentColors[2],(Color)componentColors[2],0.5f), + (Color)componentColors[2], + decodeColor((Color)componentColors[2],(Color)componentColors[3],0.5f), + (Color)componentColors[3], + decodeColor((Color)componentColors[3],(Color)componentColors[3],0.5f), + (Color)componentColors[3]}); + } + + private Paint decodeGradient11(Shape s) { + Rectangle2D bounds = s.getBounds2D(); + float x = (float)bounds.getX(); + float y = (float)bounds.getY(); + float w = (float)bounds.getWidth(); + float h = (float)bounds.getHeight(); + return decodeGradient((0.5f * w) + x, (0.0f * h) + y, (0.5f * w) + x, (1.0f * h) + y, + new float[] { 0.05f,0.5f,0.95f }, + new Color[] { color45, + decodeColor(color45,color46,0.5f), + color46}); + } + + +} Added: classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/CheckBoxMenuItemPainter.java =================================================================== --- classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/CheckBoxMenuItemPainter.java (rev 0) +++ classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/CheckBoxMenuItemPainter.java 2011-07-15 18:06:22 UTC (rev 5831) @@ -0,0 +1,163 @@ +/* + * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.sun.java.swing.plaf.nimbus; + +import com.sun.java.swing.Painter; + +import java.awt.*; +import java.awt.geom.*; +import java.awt.image.*; +import javax.swing.*; + + +final class CheckBoxMenuItemPainter extends AbstractRegionPainter { + //package private integers representing the available states that + //this painter will paint. These are used when creating a new instance + //of CheckBoxMenuItemPainter to determine which region/state is being painted + //by that instance. + static final int BACKGROUND_DISABLED = 1; + static final int BACKGROUND_ENABLED = 2; + static final int BACKGROUND_MOUSEOVER = 3; + static final int BACKGROUND_SELECTED_MOUSEOVER = 4; + static final int CHECKICON_DISABLED_SELECTED = 5; + static final int CHECKICON_ENABLED_SELECTED = 6; + static final int CHECKICON_SELECTED_MOUSEOVER = 7; + + + private int state; //refers to one of the static final ints above + private PaintContext ctx; + + //the following 4 variables are reused during the painting code of the layers + private Path2D path = new Path2D.Float(); + private Rectangle2D rect = new Rectangle2D.Float(0, 0, 0, 0); + private RoundRectangle2D roundRect = new RoundRectangle2D.Float(0, 0, 0, 0, 0, 0); + private Ellipse2D ellipse = new Ellipse2D.Float(0, 0, 0, 0); + + //All Colors used for painting are stored here. Ideally, only those colors being used + //by a particular instance of CheckBoxMenuItemPainter would be created. For the moment at least, + //however, all are created for each instance. + private Color color1 = decodeColor("nimbusSelection", 0.0f, 0.0f, 0.0f, 0); + private Color color2 = decodeColor("nimbusBlueGrey", 0.0f, -0.08983666f, -0.17647058f, 0); + private Color color3 = decodeColor("nimbusBlueGrey", 0.055555582f, -0.096827686f, -0.45882353f, 0); + private Color color4 = decodeColor("nimbusBlueGrey", 0.0f, -0.110526316f, 0.25490195f, 0); + + + //Array of current component colors, updated in each paint call + private Object[] componentColors; + + public CheckBoxMenuItemPainter(PaintContext ctx, int state) { + super(); + this.state = state; + this.ctx = ctx; + } + + @Override + protected void doPaint(Graphics2D g, JComponent c, int width, int height, Object[] extendedCacheKeys) { + //populate componentColors array with colors calculated in getExtendedCacheKeys call + componentColors = extendedCacheKeys; + //generate this entire method. Each state/bg/fg/border combo that has + //been painted gets its own KEY and paint method. + switch(state) { + case BACKGROUND_MOUSEOVER: paintBackgroundMouseOver(g); break; + case BACKGROUND_SELECTED_MOUSEOVER: paintBackgroundSelectedAndMouseOver(g); break; + case CHECKICON_DISABLED_SELECTED: paintcheckIconDisabledAndSelected(g); break; + case CHECKICON_ENABLED_SELECTED: paintcheckIconEnabledAndSelected(g); break; + case CHECKICON_SELECTED_MOUSEOVER: paintcheckIconSelectedAndMouseOver(g); break; + + } + } + + + + @Override + protected final PaintContext getPaintContext() { + return ctx; + } + + private void paintBackgroundMouseOver(Graphics2D g) { + rect = decodeRect1(); + g.setPaint(color1); + g.fill(rect); + + } + + private void paintBackgroundSelectedAndMouseOver(Graphics2D g) { + rect = decodeRect1(); + g.setPaint(color1); + g.fill(rect); + + } + + private void paintcheckIconDisabledAndSelected(Graphics2D g) { + path = decodePath1(); + g.setPaint(color2); + g.fill(path); + + } + + private void paintcheckIconEnabledAndSelected(Graphics2D g) { + path = decodePath1(); + g.setPaint(color3); + g.fill(path); + + } + + private void paintcheckIconSelectedAndMouseOver(Graphics2D g) { + path = decodePath1(); + g.setPaint(color4); + g.fill(path); + + } + + + + private Rectangle2D decodeRect1() { + rect.setRect(decodeX(1.0f), //x + decodeY(1.0f), //y + decodeX(2.0f) - decodeX(1.0f), //width + decodeY(2.0f) - decodeY(1.0f)); //height + return rect; + } + + private Path2D decodePath1() { + path.reset(); + path.moveTo(decodeX(0.0f), decodeY(1.5f)); + path.lineTo(decodeX(0.4292683f), decodeY(1.5f)); + path.lineTo(decodeX(0.7121951f), decodeY(2.4780488f)); + path.lineTo(decodeX(2.5926828f), decodeY(0.0f)); + path.lineTo(decodeX(3.0f), decodeY(0.0f)); + path.lineTo(decodeX(3.0f), decodeY(0.2f)); + path.lineTo(decodeX(2.8317075f), decodeY(0.39512196f)); + path.lineTo(decodeX(0.8f), decodeY(3.0f)); + path.lineTo(decodeX(0.5731707f), decodeY(3.0f)); + path.lineTo(decodeX(0.0f), decodeY(1.5f)); + path.closePath(); + return path; + } + + + + +} Added: classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/CheckBoxPainter.java =================================================================== --- classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/CheckBoxPainter.java (rev 0) +++ classlib6/core/src/icedtea/com/sun/java/swing/plaf/nimbus/CheckBoxPainter.java 2011-07-15 18:06:22 UTC (rev 5831) @@ -0,0 +1,636 @@ +/* + * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.sun.java.swing.plaf.nimbus; + +import com.sun.java.swing.Painter; + +import java.awt.*; +import java.awt.geom.*; +import java.awt.image.*; +import javax.swing.*; + + +final class CheckBoxPainter extends AbstractRegionPainter { + //package private integers representing the available states that + //this painter will paint. These are used when creating a new instance + //of CheckBoxPainter to determine which region/state is being painted + //by that instance. + static final int BACKGROUND_DISABLED = 1; + static final int BACKGROUND_ENABLED = 2; + static final int ICON_DISABLED = 3; + static final int ICON_ENABLED = 4; + static final int ICON_FOCUSED = 5; + static final int ICON_MOUSEOVER = 6; + static final int ICON_MOUSEOVER_FOCUSED = 7; + static final int ICON_PRESSED = 8; + static final int ICON_PRESSED_FOCUSED = 9; + static final int ICON_SELECTED = 10; + static final int ICON_SELECTED_FOCUSED = 11; + static final int ICON_PRESSED_SELECTED = 12; + static final int ICON_PRESSED_SELECTED_FOCUSED = 13; + static final int ICON_MOUSEOVER_SELECTED = 14; + static final int ICON_MOUSEOVER_SELECTED_FOCUSED = 15; + static final int ICON_DISABLED_SELECTED = 16; + + + private int state; //refers to one of the static final ints above + private PaintContext ctx; + + //the following 4 variables are reused during the painting code of the layers + private Path2D path = new Path2D.Float(); + private Rectangle2D rect = new Rectangle2D.Float(0, 0, 0, 0); + private RoundRectangle2D roundRect = new RoundRectangle2D.Float(0, 0, 0, 0, 0, 0); + private Ellipse2D ellipse = new Ellipse2D.Float(0, 0, 0, 0); + + //All Colors used for painting are stored here. Ideally, only those colors being used + //by a particular instance of CheckBoxPainter would be created. For the moment at least, + //however, all are created for each instance. + private Color color1 = decodeColor("nimbusBlueGrey", 0.0f, -0.06766917f, 0.07843137f, 0); + private Color color2 = decodeColor("nimbusBlueGrey", 0.0f, -0.06484103f, 0.027450979f, 0); + private Color color3 = decodeColor("nimbusBase", 0.032459438f, -0.60996324f, 0.36470586f, 0); + private Color color4 = decodeColor("nimbusBase", 0.02551502f, -0.5996783f, 0.3215686f, 0); + private Color color5 = decodeColor("nimbusBase", 0.032459438f, -0.59624064f, 0.34509802f, 0); + private Color color6 = decodeColor("nimbusBlueGrey", 0.0f, 0.0f, 0.0f, -89); + private Color color7 = decodeColor("nimbusBlueGrey", 0.0f, -0.05356429f, -0.12549019f, 0); + private Color color8 = decodeColor("nimbusBlueGrey", 0.0f, -0.015789472f, -0.37254903f, 0); + private Color color9 = decodeColor("nimbusBase", 0.08801502f, -0.6... [truncated message content] |
From: <ls...@us...> - 2011-06-30 20:21:52
|
Revision: 5830 http://jnode.svn.sourceforge.net/jnode/?rev=5830&view=rev Author: lsantha Date: 2011-06-30 20:21:46 +0000 (Thu, 30 Jun 2011) Log Message: ----------- Fixed cp-compare target. Modified Paths: -------------- trunk/all/build.xml Modified: trunk/all/build.xml =================================================================== --- trunk/all/build.xml 2011-06-30 20:20:36 UTC (rev 5829) +++ trunk/all/build.xml 2011-06-30 20:21:46 UTC (rev 5830) @@ -798,21 +798,9 @@ <delete dir="${build.dir}/classpath-compare"/> <cp-compare destdir="${build.dir}/classpath-compare" type="classpath"> <vmsources> - <fileset dir="${root.dir}/core/src/classpath/gnu"> + <fileset dir="${root.dir}/core/src/classpath/ext"> <patternset refid="cp-includes-pattern"/> </fileset> - <fileset dir="${root.dir}/core/src/classpath/java"> - <patternset refid="cp-includes-pattern"/> - </fileset> - <fileset dir="${root.dir}/core/src/classpath/javax"> - <patternset refid="cp-includes-pattern"/> - </fileset> - <fileset dir="${root.dir}/core/src/classpath/tools"> - <patternset refid="cp-includes-pattern"/> - </fileset> - <fileset dir="${root.dir}/core/src/classpath/sun"> - <patternset refid="cp-includes-pattern"/> - </fileset> </vmsources> <vmspecificsources> <fileset dir="${root.dir}/core/src/classpath/vm"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2011-06-30 20:20:43
|
Revision: 5829 http://jnode.svn.sourceforge.net/jnode/?rev=5829&view=rev Author: lsantha Date: 2011-06-30 20:20:36 +0000 (Thu, 30 Jun 2011) Log Message: ----------- JDIVirtualMachine for easier class hotswapping. Modified Paths: -------------- trunk/core/src/classpath/vm/gnu/classpath/jdwp/NativeVMVirtualMachine.java Added Paths: ----------- trunk/core/src/classpath/vm/gnu/classpath/jdwp/JDIVirtualMachine.java Added: trunk/core/src/classpath/vm/gnu/classpath/jdwp/JDIVirtualMachine.java =================================================================== --- trunk/core/src/classpath/vm/gnu/classpath/jdwp/JDIVirtualMachine.java (rev 0) +++ trunk/core/src/classpath/vm/gnu/classpath/jdwp/JDIVirtualMachine.java 2011-06-30 20:20:36 UTC (rev 5829) @@ -0,0 +1,266 @@ +package gnu.classpath.jdwp; + +import gnu.classpath.jdwp.event.EventRequest; +import gnu.classpath.jdwp.util.MethodResult; +import java.lang.reflect.Method; +import java.nio.ByteBuffer; +import java.security.ProtectionDomain; +import java.util.ArrayList; +import java.util.Iterator; +import org.jnode.annotation.NoInline; +import org.jnode.vm.BaseVmArchitecture; +import org.jnode.vm.VmSystem; +import org.jnode.vm.VmSystemClassLoader; +import org.jnode.vm.classmgr.ClassDecoder; +import org.jnode.vm.classmgr.VmByteCode; +import org.jnode.vm.classmgr.VmClassLoader; +import org.jnode.vm.classmgr.VmIsolatedStatics; +import org.jnode.vm.classmgr.VmMethod; +import org.jnode.vm.classmgr.VmStaticsIterator; +import org.jnode.vm.classmgr.VmType; +import org.jnode.vm.facade.VmUtils; +import org.jnode.vm.isolate.VmIsolate; + +/** + * User: lsantha + * Date: 6/26/11 10:53 AM + */ +public class JDIVirtualMachine { + @NoInline + static boolean debug() { + return false; + } + + /** + * @see gnu.classpath.jdwp.VMVirtualMachine#suspendThread(java.lang.Thread) + */ + @NoInline + static void suspendThread(Thread arg1) { + //todo implement it + if(debug()) + System.out.println("NativeVMVirtualMachine.suspendThread()"); + } + /** + * @see gnu.classpath.jdwp.VMVirtualMachine#resumeThread(java.lang.Thread) + */ + @NoInline + static void resumeThread(Thread arg1) { + //todo implement it + if(debug()) + System.out.println("NativeVMVirtualMachine.resumeThread()"); + } + /** + * @see gnu.classpath.jdwp.VMVirtualMachine#getSuspendCount(java.lang.Thread) + */ + @NoInline + static int getSuspendCount(Thread arg1) { + //todo implement it + if(debug()) + System.out.println("NativeVMVirtualMachine.getSuspendCount()"); + return 0; + } + /** + * @see gnu.classpath.jdwp.VMVirtualMachine#getAllLoadedClassesCount() + */ + @NoInline + static int getAllLoadedClassesCount() { + //todo implement it + if(debug()) + System.out.println("NativeVMVirtualMachine.getAllLoadedClassesCount()"); + return 0; + } + /** + * @see gnu.classpath.jdwp.VMVirtualMachine#getAllLoadedClasses() + */ + @NoInline + static Iterator getAllLoadedClasses() { + if(debug()) + System.out.println("NativeVMVirtualMachine.getAllLoadedClasses()"); + return new Iterator() { + private VmStaticsIterator iter = new VmStaticsIterator(VmUtils.getVm().getSharedStatics()); + private Iterator<VmIsolatedStatics> isolated = VmIsolate.staticsIterator(); + + public boolean hasNext() { + if (iter.hasNext()) + return true; + else { + while (isolated.hasNext()) { + iter = new VmStaticsIterator(isolated.next()); + if (iter.hasNext()) + return true; + } + } + return false; + } + + public Object next() { + return iter.next().asClass(); + } + + public void remove() { + throw new UnsupportedOperationException(); + } + }; + } + /** + * @see gnu.classpath.jdwp.VMVirtualMachine#getClassStatus(java.lang.Class) + */ + @NoInline + static int getClassStatus(Class arg1) { + //todo implement it + if(debug()) + System.out.println("NativeVMVirtualMachine.getClassStatus()"); + return 0; + } + /** + * @see gnu.classpath.jdwp.VMVirtualMachine#getAllClassMethods(java.lang.Class) + */ + @NoInline + static VMMethod[] getAllClassMethods(Class arg1) { + //todo implement it + if(debug()) + System.out.println("NativeVMVirtualMachine.getAllClassMethods()"); + return null; + } + /** + * @see gnu.classpath.jdwp.VMVirtualMachine#getClassMethod(java.lang.Class, long) + */ + @NoInline + static VMMethod getClassMethod(Class arg1, long arg2) { + //todo implement it + if(debug()) + System.out.println("NativeVMVirtualMachine.getClassMethod()"); + return null; + } + /** + * @see gnu.classpath.jdwp.VMVirtualMachine#getFrames(java.lang.Thread, int, int) + */ + @NoInline + static ArrayList getFrames(Thread arg1, int arg2, int arg3) { + //todo implement it + if(debug()) + System.out.println("NativeVMVirtualMachine.getFrame()"); + return null; + } + /** + * @see gnu.classpath.jdwp.VMVirtualMachine#getFrame(java.lang.Thread, java.nio.ByteBuffer) + */ + @NoInline + static VMFrame getFrame(Thread arg1, ByteBuffer arg2) { + //todo implement it + if(debug()) + System.out.println("NativeVMVirtualMachine.getFrame()"); + return null; + } + /** + * @see gnu.classpath.jdwp.VMVirtualMachine#getFrameCount(java.lang.Thread) + */ + @NoInline + static int getFrameCount(Thread arg1) { + //todo implement it + if(debug()) + System.out.println("NativeVMVirtualMachine.getFrameCount()"); + return 0; + } + /** + * @see gnu.classpath.jdwp.VMVirtualMachine#getThreadStatus(java.lang.Thread) + */ + @NoInline + static int getThreadStatus(Thread thread) { + //todo implement it + if(debug()) + System.out.println("NativeVMVirtualMachine.getThreadStatus()"); + +// public static final int ZOMBIE = 0; +// public static final int RUNNING = 1; +// public static final int SLEEPING = 2; +// public static final int MONITOR = 3; +// public static final int WAIT = 4; + + return 0; + } + /** + * @see gnu.classpath.jdwp.VMVirtualMachine#getLoadRequests(java.lang.ClassLoader) + */ + @NoInline + static ArrayList getLoadRequests(ClassLoader arg1) { + //todo implement it + if(debug()) + System.out.println("NativeVMVirtualMachine.getLoadRequest()"); + return null; + } + /** + * @see gnu.classpath.jdwp.VMVirtualMachine#executeMethod(java.lang.Object, java.lang.Thread, java.lang.Class, java.lang.reflect.Method, java.lang.Object[], boolean) + */ + @NoInline + static MethodResult executeMethod(Object arg1, Thread arg2, Class arg3, Method arg4, Object[] arg5, boolean arg6) { + //todo implement it + if(debug()) + System.out.println("NativeVMVirtualMachine.executeMethod()"); + return null; + } + /** + * @see gnu.classpath.jdwp.VMVirtualMachine#getSourceFile(java.lang.Class) + */ + @NoInline + static String getSourceFile(Class arg1) { + //todo implement it + if(debug()) + System.out.println("NativeVMVirtualMachine.getSourceFile()"); + return null; + } + /** + * @see gnu.classpath.jdwp.VMVirtualMachine#registerEvent(gnu.classpath.jdwp.event.EventRequest) + */ + @NoInline + static void registerEvent(EventRequest arg1) { + //todo implement it + if(debug()) + System.out.println("NativeVMVirtualMachine.registerEvent() " + arg1.getId() + " " + arg1.getEventKind() + + " " + arg1.getSuspendPolicy() + " " + arg1.getFilters()); + } + /** + * @see gnu.classpath.jdwp.VMVirtualMachine#unregisterEvent(gnu.classpath.jdwp.event.EventRequest) + */ + @NoInline + static void unregisterEvent(EventRequest arg1) { + //todo implement it + if(debug()) + System.out.println("NativeVMVirtualMachine.unregisterEvent()"); + } + /** + * @see gnu.classpath.jdwp.VMVirtualMachine#clearEvents(byte) + */ + @NoInline + static void clearEvents(byte arg1) { + //todo implement it + if(debug()) + System.out.println("NativeVMVirtualMachine.clearEvents()"); + } + /** + * @see gnu.classpath.jdwp.VMVirtualMachine#redefineClass(Class, byte[]) + */ + @NoInline + static void redefineClass(Class oldClass, byte[] classData){ + if(debug()) + System.out.println("NativeVMVirtualMachine.redefineClass()"); + + String name = oldClass.getName(); + VmType old_type = VmType.fromClass(oldClass); + VmClassLoader loader = VmType.fromClass(oldClass).getLoader(); + ProtectionDomain pd = oldClass.getProtectionDomain(); + VmType new_type = ClassDecoder.defineClass(name, ByteBuffer.wrap(classData), false, loader, pd); + for(int i = 0; i < old_type.getNoDeclaredMethods(); i++){ + VmMethod old_method = old_type.getDeclaredMethod(i); + if (!old_method.isNative()) { + VmMethod new_method = new_type.getDeclaredMethod(old_method.getName(), old_method.getSignature()); + if(new_method == null) continue; + + old_method.setBytecode(new_method.getBytecode()); + old_method.resetOptLevel(); + old_method.recompile(); + System.out.println("Redefined method: " + old_method.getFullName()); + } + } + } +} Modified: trunk/core/src/classpath/vm/gnu/classpath/jdwp/NativeVMVirtualMachine.java =================================================================== --- trunk/core/src/classpath/vm/gnu/classpath/jdwp/NativeVMVirtualMachine.java 2011-06-30 20:17:44 UTC (rev 5828) +++ trunk/core/src/classpath/vm/gnu/classpath/jdwp/NativeVMVirtualMachine.java 2011-06-30 20:20:36 UTC (rev 5829) @@ -42,211 +42,118 @@ * @author Levente S\u00e1ntha */ class NativeVMVirtualMachine { - @NoInline -// public static boolean debug() { -// return true; -// } - /** * @see gnu.classpath.jdwp.VMVirtualMachine#suspendThread(java.lang.Thread) */ private static void suspendThread(Thread arg1) { - //todo implement it -// if(debug()) - System.out.println("NativeVMVirtualMachine.suspendThread()"); + JDIVirtualMachine.suspendThread(arg1); } /** * @see gnu.classpath.jdwp.VMVirtualMachine#resumeThread(java.lang.Thread) */ private static void resumeThread(Thread arg1) { - //todo implement it -// if(debug()) - System.out.println("NativeVMVirtualMachine.resumeThread()"); + JDIVirtualMachine.resumeThread(arg1); } /** * @see gnu.classpath.jdwp.VMVirtualMachine#getSuspendCount(java.lang.Thread) */ private static int getSuspendCount(Thread arg1) { - //todo implement it -// if(debug()) - System.out.println("NativeVMVirtualMachine.getSuspendCount()"); - return 0; + return JDIVirtualMachine.getSuspendCount(arg1); } /** * @see gnu.classpath.jdwp.VMVirtualMachine#getAllLoadedClassesCount() */ private static int getAllLoadedClassesCount() { - //todo implement it -// if(debug()) - System.out.println("NativeVMVirtualMachine.getAllLoadedClassesCount()"); - return 0; + return JDIVirtualMachine.getAllLoadedClassesCount(); } /** * @see gnu.classpath.jdwp.VMVirtualMachine#getAllLoadedClasses() */ private static Iterator getAllLoadedClasses() { -// if(debug()) - System.out.println("NativeVMVirtualMachine.getAllLoadedClasses()"); - return new Iterator() { - private VmStaticsIterator iter = new VmStaticsIterator(VmUtils.getVm().getSharedStatics()); - private Iterator<VmIsolatedStatics> isolated = VmIsolate.staticsIterator(); - - public boolean hasNext() { - if (iter.hasNext()) - return true; - else { - while (isolated.hasNext()) { - iter = new VmStaticsIterator(isolated.next()); - if (iter.hasNext()) - return true; - } - } - return false; - } - - public Object next() { - return iter.next().asClass(); - } - - public void remove() { - throw new UnsupportedOperationException(); - } - }; + return JDIVirtualMachine.getAllLoadedClasses(); } /** * @see gnu.classpath.jdwp.VMVirtualMachine#getClassStatus(java.lang.Class) */ private static int getClassStatus(Class arg1) { - //todo implement it -// if(debug()) - System.out.println("NativeVMVirtualMachine.getClassStatus()"); - return 0; + return JDIVirtualMachine.getClassStatus(arg1); } /** * @see gnu.classpath.jdwp.VMVirtualMachine#getAllClassMethods(java.lang.Class) */ private static VMMethod[] getAllClassMethods(Class arg1) { - //todo implement it -// if(debug()) - System.out.println("NativeVMVirtualMachine.getAllClassMethods()"); - return null; + return JDIVirtualMachine.getAllClassMethods(arg1); } /** * @see gnu.classpath.jdwp.VMVirtualMachine#getClassMethod(java.lang.Class, long) */ private static VMMethod getClassMethod(Class arg1, long arg2) { - //todo implement it -// if(debug()) - System.out.println("NativeVMVirtualMachine.getClassMethod()"); - return null; + return JDIVirtualMachine.getClassMethod(arg1, arg2); } /** * @see gnu.classpath.jdwp.VMVirtualMachine#getFrames(java.lang.Thread, int, int) */ private static ArrayList getFrames(Thread arg1, int arg2, int arg3) { - //todo implement it -// if(debug()) - System.out.println("NativeVMVirtualMachine.getFrame()"); - return null; + return JDIVirtualMachine.getFrames(arg1, arg2, arg3); } /** * @see gnu.classpath.jdwp.VMVirtualMachine#getFrame(java.lang.Thread, java.nio.ByteBuffer) */ private static VMFrame getFrame(Thread arg1, ByteBuffer arg2) { - //todo implement it -// if(debug()) - System.out.println("NativeVMVirtualMachine.getFrame()"); - return null; + return JDIVirtualMachine.getFrame(arg1, arg2); } /** * @see gnu.classpath.jdwp.VMVirtualMachine#getFrameCount(java.lang.Thread) */ private static int getFrameCount(Thread arg1) { - //todo implement it -// if(debug()) - System.out.println("NativeVMVirtualMachine.getFrameCount()"); - return 0; + return JDIVirtualMachine.getFrameCount(arg1); } /** * @see gnu.classpath.jdwp.VMVirtualMachine#getThreadStatus(java.lang.Thread) */ private static int getThreadStatus(Thread arg1) { - //todo implement it -// if(debug()) - System.out.println("NativeVMVirtualMachine.getThreadStatus()"); - return 0; + return JDIVirtualMachine.getThreadStatus(arg1); } /** * @see gnu.classpath.jdwp.VMVirtualMachine#getLoadRequests(java.lang.ClassLoader) */ private static ArrayList getLoadRequests(ClassLoader arg1) { - //todo implement it -// if(debug()) - System.out.println("NativeVMVirtualMachine.getLoadRequest()"); - return null; + return JDIVirtualMachine.getLoadRequests(arg1); } /** * @see gnu.classpath.jdwp.VMVirtualMachine#executeMethod(java.lang.Object, java.lang.Thread, java.lang.Class, java.lang.reflect.Method, java.lang.Object[], boolean) */ private static MethodResult executeMethod(Object arg1, Thread arg2, Class arg3, Method arg4, Object[] arg5, boolean arg6) { - //todo implement it -// if(debug()) - System.out.println("NativeVMVirtualMachine.executeMethod()"); - return null; + return JDIVirtualMachine.executeMethod(arg1, arg2, arg3, arg4, arg5, arg6); } /** * @see gnu.classpath.jdwp.VMVirtualMachine#getSourceFile(java.lang.Class) */ private static String getSourceFile(Class arg1) { - //todo implement it -// if(debug()) - System.out.println("NativeVMVirtualMachine.getSourceFile()"); - return null; + return JDIVirtualMachine.getSourceFile(arg1); } /** * @see gnu.classpath.jdwp.VMVirtualMachine#registerEvent(gnu.classpath.jdwp.event.EventRequest) */ private static void registerEvent(EventRequest arg1) { - //todo implement it -// if(debug()) - System.out.println("NativeVMVirtualMachine.registerEvent() " + arg1.getId() + " " + arg1.getEventKind() + - " " + arg1.getSuspendPolicy() + " " + arg1.getFilters()); + JDIVirtualMachine.registerEvent(arg1); } /** * @see gnu.classpath.jdwp.VMVirtualMachine#unregisterEvent(gnu.classpath.jdwp.event.EventRequest) */ private static void unregisterEvent(EventRequest arg1) { - //todo implement it -// if(debug()) - System.out.println("NativeVMVirtualMachine.unregisterEvent()"); + JDIVirtualMachine.unregisterEvent(arg1); } /** * @see gnu.classpath.jdwp.VMVirtualMachine#clearEvents(byte) */ private static void clearEvents(byte arg1) { - //todo implement it -// if(debug()) - System.out.println("NativeVMVirtualMachine.clearEvents()"); + JDIVirtualMachine.clearEvents(arg1); } - + /** + * @see gnu.classpath.jdwp.VMVirtualMachine#redefineClass(Class, byte[]) + */ public static void redefineClass(Class oldClass, byte[] classData){ -// if(debug()) - System.out.println("NativeVMVirtualMachine.redefineClass()"); - VmType old_type = VmType.fromClass(oldClass); - VmType new_type = ClassDecoder.defineClass(oldClass.getName(), - ByteBuffer.wrap(classData), false, - VmType.fromClass(oldClass).getLoader(), - oldClass.getProtectionDomain()); - for(int i = 0; i < old_type.getNoDeclaredMethods(); i++){ - VmMethod old_method = old_type.getDeclaredMethod(i); - if(!old_method.isNative()){ - VmMethod new_method = new_type.getDeclaredMethod(old_method.getName(), old_method.getSignature()); - if(new_method == null) continue; - old_method.setBytecode(new_method.getBytecode()); - old_method.resetOptLevel(); - old_method.recompile(); - System.out.println("Redefined: " + old_method); - } - } + JDIVirtualMachine.redefineClass(oldClass, classData); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2011-06-30 20:17:50
|
Revision: 5828 http://jnode.svn.sourceforge.net/jnode/?rev=5828&view=rev Author: lsantha Date: 2011-06-30 20:17:44 +0000 (Thu, 30 Jun 2011) Log Message: ----------- Fixed typo. Modified Paths: -------------- trunk/distr/src/apps/org/jnode/games/boxworld/BoxWorld.java Modified: trunk/distr/src/apps/org/jnode/games/boxworld/BoxWorld.java =================================================================== --- trunk/distr/src/apps/org/jnode/games/boxworld/BoxWorld.java 2011-06-25 21:09:06 UTC (rev 5827) +++ trunk/distr/src/apps/org/jnode/games/boxworld/BoxWorld.java 2011-06-30 20:17:44 UTC (rev 5828) @@ -1329,7 +1329,7 @@ public static void main(String[] argv) { BoxWorld bw = new BoxWorld(); bw.init(); - Frame frame = new JFrame("Boxworld"); + Frame frame = new JFrame("BoxWorld"); frame.setResizable(false); frame.add(bw); frame.addWindowListener(bw); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2011-06-25 21:09:12
|
Revision: 5827 http://jnode.svn.sourceforge.net/jnode/?rev=5827&view=rev Author: lsantha Date: 2011-06-25 21:09:06 +0000 (Sat, 25 Jun 2011) Log Message: ----------- Improved remote debugging. Now standard Java debuggers can connect to JNode. Modified Paths: -------------- trunk/cli/src/commands/org/jnode/command/dev/DebugCommand.java Modified: trunk/cli/src/commands/org/jnode/command/dev/DebugCommand.java =================================================================== --- trunk/cli/src/commands/org/jnode/command/dev/DebugCommand.java 2011-06-25 21:07:57 UTC (rev 5826) +++ trunk/cli/src/commands/org/jnode/command/dev/DebugCommand.java 2011-06-25 21:09:06 UTC (rev 5827) @@ -20,7 +20,7 @@ package org.jnode.command.dev; -import gnu.classpath.jdwp.JNodeSocketTransport; +import gnu.classpath.jdwp.transport.JNodeSocketTransport; import gnu.classpath.jdwp.Jdwp; import java.io.PrintWriter; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |