MemoryImageSource.java, [...]: New versions from classpath.
2003-07-14 Michael Koch <konqueror@gmx.de> * java/awt/image/MemoryImageSource.java, java/beans/PropertyEditorManager.java, javax/naming/CompoundName.java, javax/naming/spi/NamingManager.java, javax/swing/AbstractButton.java, javax/swing/ButtonModel.java, javax/swing/SwingUtilities.java, javax/swing/UIManager.java, javax/swing/colorchooser/DefaultColorSelectionModel.java, javax/swing/event/AncestorEvent.java, javax/swing/event/InternalFrameEvent.java, java/util/zip/ZipFile.java: New versions from classpath. From-SVN: r69321
This commit is contained in:
parent
6e98504002
commit
6a71677713
13 changed files with 1095 additions and 1077 deletions
|
@ -1,3 +1,19 @@
|
||||||
|
2003-07-14 Michael Koch <konqueror@gmx.de>
|
||||||
|
|
||||||
|
* java/awt/image/MemoryImageSource.java,
|
||||||
|
java/beans/PropertyEditorManager.java,
|
||||||
|
javax/naming/CompoundName.java,
|
||||||
|
javax/naming/spi/NamingManager.java,
|
||||||
|
javax/swing/AbstractButton.java,
|
||||||
|
javax/swing/ButtonModel.java,
|
||||||
|
javax/swing/SwingUtilities.java,
|
||||||
|
javax/swing/UIManager.java,
|
||||||
|
javax/swing/colorchooser/DefaultColorSelectionModel.java,
|
||||||
|
javax/swing/event/AncestorEvent.java,
|
||||||
|
javax/swing/event/InternalFrameEvent.java,
|
||||||
|
java/util/zip/ZipFile.java:
|
||||||
|
New versions from classpath.
|
||||||
|
|
||||||
2003-07-13 Michael Koch <konqueror@gmx.de>
|
2003-07-13 Michael Koch <konqueror@gmx.de>
|
||||||
|
|
||||||
* gnu/java/nio/FileChannelImpl.java,
|
* gnu/java/nio/FileChannelImpl.java,
|
||||||
|
|
|
@ -74,7 +74,7 @@ public class MemoryImageSource implements ImageProducer
|
||||||
this.props = props;
|
this.props = props;
|
||||||
int max = (( scansize > width ) ? scansize : width );
|
int max = (( scansize > width ) ? scansize : width );
|
||||||
pixelb = new byte[ max * height ];
|
pixelb = new byte[ max * height ];
|
||||||
System.arraycopy( pix, 0, pixelb, 0, max );
|
System.arraycopy( pix, 0, pixelb, 0, max * height );
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
Constructs an ImageProducer from memory
|
Constructs an ImageProducer from memory
|
||||||
|
@ -100,7 +100,7 @@ public class MemoryImageSource implements ImageProducer
|
||||||
this.props = props;
|
this.props = props;
|
||||||
int max = (( scansize > width ) ? scansize : width );
|
int max = (( scansize > width ) ? scansize : width );
|
||||||
pixeli = new int[ max * height ];
|
pixeli = new int[ max * height ];
|
||||||
System.arraycopy( pix, 0, pixeli, 0, max );
|
System.arraycopy( pix, 0, pixeli, 0, max * height );
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
Constructs an ImageProducer from memory using the default RGB ColorModel
|
Constructs an ImageProducer from memory using the default RGB ColorModel
|
||||||
|
@ -226,6 +226,7 @@ public class MemoryImageSource implements ImageProducer
|
||||||
if( props != null ) {
|
if( props != null ) {
|
||||||
ic.setProperties( props );
|
ic.setProperties( props );
|
||||||
}
|
}
|
||||||
|
ic.setDimensions(width, height);
|
||||||
if( pixeli != null ) {
|
if( pixeli != null ) {
|
||||||
ic.setPixels( 0, 0, width, height, cm, pixeli, offset, scansize );
|
ic.setPixels( 0, 0, width, height, cm, pixeli, offset, scansize );
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -140,9 +140,13 @@ public class PropertyEditorManager
|
||||||
return (PropertyEditor)found.newInstance();
|
return (PropertyEditor)found.newInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ClassLoader contextClassLoader
|
||||||
|
= Thread.currentThread().getContextClassLoader();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
found = Class.forName(editedClass.getName()+"Editor");
|
found = Class.forName(editedClass.getName()+"Editor", true,
|
||||||
|
contextClassLoader);
|
||||||
registerEditor(editedClass,found);
|
registerEditor(editedClass,found);
|
||||||
return (PropertyEditor)found.newInstance();
|
return (PropertyEditor)found.newInstance();
|
||||||
}
|
}
|
||||||
|
@ -150,14 +154,18 @@ public class PropertyEditorManager
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
String appendName = "." + ClassHelper.getTruncatedClassName(editedClass) + "Editor";
|
String appendName
|
||||||
|
= "."
|
||||||
|
+ ClassHelper.getTruncatedClassName(editedClass)
|
||||||
|
+ "Editor";
|
||||||
synchronized(editorSearchPath)
|
synchronized(editorSearchPath)
|
||||||
{
|
{
|
||||||
for(int i=0;i<editorSearchPath.length;i++)
|
for(int i=0;i<editorSearchPath.length;i++)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
found = Class.forName(editorSearchPath[i] + appendName);
|
found = Class.forName(editorSearchPath[i] + appendName,
|
||||||
|
true, contextClassLoader);
|
||||||
registerEditor(editedClass,found);
|
registerEditor(editedClass,found);
|
||||||
return (PropertyEditor)found.newInstance();
|
return (PropertyEditor)found.newInstance();
|
||||||
}
|
}
|
||||||
|
|
|
@ -308,7 +308,7 @@ public class ZipFile implements ZipConstants
|
||||||
*/
|
*/
|
||||||
protected void finalize() throws IOException
|
protected void finalize() throws IOException
|
||||||
{
|
{
|
||||||
if (!closed) close();
|
if (!closed && raf != null) close();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -142,13 +142,17 @@ public class CompoundName implements Name, Cloneable, Serializable
|
||||||
// Otherwise, fall through.
|
// Otherwise, fall through.
|
||||||
}
|
}
|
||||||
// Quotes are only special at the start of a component.
|
// Quotes are only special at the start of a component.
|
||||||
else if (new_element.length () == 0 && special == beginQuote)
|
else if (new_element.length () == 0
|
||||||
|
&& special == beginQuote
|
||||||
|
&& beginQuote != null)
|
||||||
{
|
{
|
||||||
quote = endQuote;
|
quote = endQuote;
|
||||||
i += special.length ();
|
i += special.length ();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (new_element.length () == 0 && special == beginQuote2)
|
else if (new_element.length () == 0
|
||||||
|
&& special == beginQuote2
|
||||||
|
&& beginQuote2 != null)
|
||||||
{
|
{
|
||||||
quote = endQuote2;
|
quote = endQuote2;
|
||||||
i += special.length ();
|
i += special.length ();
|
||||||
|
|
|
@ -83,13 +83,17 @@ public class NamingManager
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
icf = (InitialContextFactory) Class.forName (java_naming_factory_initial).newInstance ();
|
icf = (InitialContextFactory)Class.forName
|
||||||
|
(java_naming_factory_initial, true,
|
||||||
|
Thread.currentThread().getContextClassLoader())
|
||||||
|
.newInstance ();
|
||||||
}
|
}
|
||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
NoInitialContextException e
|
NoInitialContextException e
|
||||||
= new NoInitialContextException ("Can't load InitialContextFactory class: "
|
= new NoInitialContextException
|
||||||
+ java_naming_factory_initial);
|
("Can't load InitialContextFactory class: "
|
||||||
|
+ java_naming_factory_initial);
|
||||||
e.setRootCause(exception);
|
e.setRootCause(exception);
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -76,12 +76,4 @@ public interface ButtonModel extends ItemSelectable
|
||||||
|
|
||||||
void setSelected(boolean b);
|
void setSelected(boolean b);
|
||||||
boolean isSelected();
|
boolean isSelected();
|
||||||
|
|
||||||
|
|
||||||
// there are not in the spec !!
|
|
||||||
|
|
||||||
|
|
||||||
void fireItemStateChanged(ItemEvent event);
|
|
||||||
void fireStateChanged(ChangeEvent event);
|
|
||||||
void fireActionPerformed(ActionEvent event);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,70 +58,71 @@ import javax.accessibility.AccessibleStateSet;
|
||||||
public class SwingUtilities implements SwingConstants
|
public class SwingUtilities implements SwingConstants
|
||||||
{
|
{
|
||||||
public static FontMetrics getFontMetrics (Font font)
|
public static FontMetrics getFontMetrics (Font font)
|
||||||
{
|
{
|
||||||
return Toolkit.getDefaultToolkit().getFontMetrics(font);
|
return Toolkit.getDefaultToolkit ().getFontMetrics (font);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static JRootPane getRootPane (Component a)
|
public static JRootPane getRootPane (Component a)
|
||||||
{
|
{
|
||||||
if (a instanceof JRootPane)
|
if (a instanceof JRootPane)
|
||||||
return (JRootPane) a;
|
return (JRootPane) a;
|
||||||
|
|
||||||
a = a.getParent();
|
a = a.getParent();
|
||||||
|
|
||||||
if (a != null)
|
if (a != null)
|
||||||
{
|
{
|
||||||
return getRootPane(a);
|
return getRootPane(a);
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void updateComponentTreeUI(JFrame comp)
|
public static void updateComponentTreeUI(JFrame comp)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String layoutCompoundLabel(JComponent c,
|
public static String layoutCompoundLabel(JComponent c,
|
||||||
FontMetrics fm,
|
FontMetrics fm,
|
||||||
String text,
|
String text,
|
||||||
Icon i,
|
Icon i,
|
||||||
int vert_a,
|
int vert_a,
|
||||||
int hor_i,
|
int hor_i,
|
||||||
int vert_text_pos,
|
int vert_text_pos,
|
||||||
int hor_text_pos,
|
int hor_text_pos,
|
||||||
Rectangle vr,
|
Rectangle vr,
|
||||||
Rectangle ir,
|
Rectangle ir,
|
||||||
Rectangle tr,
|
Rectangle tr,
|
||||||
int gap)
|
int gap)
|
||||||
{
|
{
|
||||||
// view rect 'vr' already ok,
|
// view rect 'vr' already ok,
|
||||||
// we need to compute ir (icon rect) and tr (text-rect)
|
// we need to compute ir (icon rect) and tr (text-rect)
|
||||||
|
|
||||||
int next_x = 0;//vr.x;
|
int next_x = 0;//vr.x;
|
||||||
int next_y = 0;//vr.y;
|
int next_y = 0;//vr.y;
|
||||||
|
|
||||||
ir.height = ir.width = ir.y = ir.x = 0;
|
ir.height = ir.width = ir.y = ir.x = 0;
|
||||||
|
|
||||||
if (i != null)
|
if (i != null)
|
||||||
{
|
{
|
||||||
ir.x = vr.x;
|
ir.x = vr.x;
|
||||||
ir.y = vr.y;
|
ir.y = vr.y;
|
||||||
ir.width = i.getIconWidth();
|
ir.width = i.getIconWidth();
|
||||||
ir.height = i.getIconWidth();
|
ir.height = i.getIconWidth();
|
||||||
|
|
||||||
|
|
||||||
next_x += gap + i.getIconWidth();
|
next_x += gap + i.getIconWidth();
|
||||||
next_y += gap + i.getIconHeight();
|
next_y += gap + i.getIconHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
tr.x = next_x;
|
tr.x = next_x;
|
||||||
tr.y = vr.y + (vr.height/2);
|
tr.y = vr.y + (vr.height/2);
|
||||||
|
|
||||||
tr.width = fm.stringWidth(text);
|
tr.width = fm.stringWidth(text);
|
||||||
tr.height = fm.getHeight() + fm.getAscent()/2;
|
tr.height = fm.getHeight() + fm.getAscent()/2;
|
||||||
|
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
|
||||||
return text;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -50,131 +50,137 @@ import javax.swing.plaf.metal.MetalLookAndFeel;
|
||||||
|
|
||||||
public class UIManager implements Serializable
|
public class UIManager implements Serializable
|
||||||
{
|
{
|
||||||
static final long serialVersionUID = -5547433830339189365L;
|
public static class LookAndFeelInfo
|
||||||
|
{
|
||||||
|
String name, clazz;
|
||||||
|
|
||||||
static class LookAndFeelInfo
|
LookAndFeelInfo(String name,
|
||||||
|
String clazz)
|
||||||
{
|
{
|
||||||
String name, clazz;
|
this.name = name;
|
||||||
|
this.clazz = clazz;
|
||||||
LookAndFeelInfo(String name,
|
|
||||||
String clazz)
|
|
||||||
{
|
|
||||||
this.name = name;
|
|
||||||
this.clazz = clazz;
|
|
||||||
}
|
|
||||||
String getName() { return name; }
|
|
||||||
String getClassName() { return clazz; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String getName() { return name; }
|
||||||
|
String getClassName() { return clazz; }
|
||||||
|
}
|
||||||
|
|
||||||
static LookAndFeelInfo [] installed = {
|
private static final long serialVersionUID = -5547433830339189365L;
|
||||||
new LookAndFeelInfo("Metal",
|
|
||||||
"javax.swing.plaf.metal.MetalLookAndFeel")
|
|
||||||
};
|
|
||||||
|
|
||||||
|
static LookAndFeelInfo [] installed = {
|
||||||
|
new LookAndFeelInfo ("Metal", "javax.swing.plaf.metal.MetalLookAndFeel")
|
||||||
|
};
|
||||||
|
|
||||||
static LookAndFeel[] aux_installed;
|
static LookAndFeel[] aux_installed;
|
||||||
|
|
||||||
static LookAndFeel look_and_feel = new MetalLookAndFeel();
|
static LookAndFeel look_and_feel = new MetalLookAndFeel();
|
||||||
|
|
||||||
|
public UIManager()
|
||||||
|
{
|
||||||
|
// Do nothing here.
|
||||||
|
}
|
||||||
|
|
||||||
UIManager()
|
public static void addPropertyChangeListener (PropertyChangeListener listener)
|
||||||
{
|
{
|
||||||
}
|
// FIXME
|
||||||
|
}
|
||||||
|
|
||||||
public static void addPropertyChangeListener(PropertyChangeListener listener)
|
public static void removePropertyChangeListener (PropertyChangeListener listener)
|
||||||
{
|
// Remove a PropertyChangeListener from the listener list.
|
||||||
// Add a PropertyChangeListener to the listener list.
|
{
|
||||||
}
|
// FIXME
|
||||||
|
}
|
||||||
|
|
||||||
public static void addAuxiliaryLookAndFeel(LookAndFeel l)
|
/**
|
||||||
{
|
* @since 1.4
|
||||||
// Add a LookAndFeel to the list of auxiliary look and feels.
|
*/
|
||||||
if (aux_installed == null)
|
public static PropertyChangeListener[] getPropertyChangeListeners ()
|
||||||
{
|
{
|
||||||
aux_installed = new LookAndFeel[1];
|
// FIXME
|
||||||
aux_installed[0] = l;
|
throw new Error ("Not implemented");
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
LookAndFeel[] T = new LookAndFeel[ aux_installed.length+1 ];
|
public static void addAuxiliaryLookAndFeel (LookAndFeel l)
|
||||||
System.arraycopy(aux_installed, 0,
|
{
|
||||||
T, 0,
|
// Add a LookAndFeel to the list of auxiliary look and feels.
|
||||||
aux_installed.length);
|
if (aux_installed == null)
|
||||||
aux_installed = T;
|
{
|
||||||
aux_installed[aux_installed.length-1] = l;
|
aux_installed = new LookAndFeel[1];
|
||||||
}
|
aux_installed[0] = l;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean removeAuxiliaryLookAndFeel(LookAndFeel laf)
|
LookAndFeel[] T = new LookAndFeel[ aux_installed.length+1 ];
|
||||||
{
|
System.arraycopy(aux_installed, 0, T, 0, aux_installed.length);
|
||||||
if (aux_installed == null)
|
aux_installed = T;
|
||||||
return false;
|
aux_installed[aux_installed.length-1] = l;
|
||||||
|
}
|
||||||
|
|
||||||
for (int i=0;i<aux_installed.length;i++)
|
public static boolean removeAuxiliaryLookAndFeel(LookAndFeel laf)
|
||||||
{
|
{
|
||||||
if (aux_installed[i] == laf)
|
if (aux_installed == null)
|
||||||
{
|
return false;
|
||||||
aux_installed[ i ] = aux_installed[aux_installed.length-1];
|
|
||||||
|
|
||||||
LookAndFeel[] T = new LookAndFeel[ aux_installed.length-1 ];
|
for (int i=0;i<aux_installed.length;i++)
|
||||||
System.arraycopy(aux_installed, 0,
|
{
|
||||||
T, 0,
|
if (aux_installed[i] == laf)
|
||||||
aux_installed.length-1);
|
{
|
||||||
aux_installed = T;
|
aux_installed[ i ] = aux_installed[aux_installed.length-1];
|
||||||
return true;
|
LookAndFeel[] T = new LookAndFeel[ aux_installed.length-1 ];
|
||||||
}
|
System.arraycopy (aux_installed, 0, T, 0, aux_installed.length-1);
|
||||||
}
|
aux_installed = T;
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public static LookAndFeel[] getAuxiliaryLookAndFeels()
|
public static LookAndFeel[] getAuxiliaryLookAndFeels()
|
||||||
{ return aux_installed; }
|
{ return aux_installed; }
|
||||||
|
|
||||||
|
public static Object get(Object key)
|
||||||
|
{ return getLookAndFeel().getDefaults().get(key); }
|
||||||
|
|
||||||
public static Object get(Object key)
|
/**
|
||||||
{ return getLookAndFeel().getDefaults().get(key); }
|
* Returns a border from the defaults table.
|
||||||
|
*/
|
||||||
|
public static Border getBorder(Object key)
|
||||||
|
{
|
||||||
|
return (Border) getLookAndFeel().getDefaults().get(key);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a border from the defaults table.
|
* Returns a drawing color from the defaults table.
|
||||||
*/
|
*/
|
||||||
public static Border getBorder(Object key)
|
public static Color getColor(Object key)
|
||||||
{
|
{
|
||||||
return (Border) getLookAndFeel().getDefaults().get(key);
|
return (Color) getLookAndFeel().getDefaults().get(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a drawing color from the defaults table.
|
* this string can be passed to Class.forName()
|
||||||
*/
|
*/
|
||||||
public static Color getColor(Object key)
|
public static String getCrossPlatformLookAndFeelClassName()
|
||||||
{
|
{
|
||||||
return (Color) getLookAndFeel().getDefaults().get(key);
|
return "javax.swing.plaf.metal.MetalLookAndFeel";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* this string can be passed to Class.forName()
|
* Returns the default values for this look and feel.
|
||||||
*/
|
*/
|
||||||
public static String getCrossPlatformLookAndFeelClassName()
|
static UIDefaults getDefaults()
|
||||||
{
|
{
|
||||||
return "javax.swing.plaf.metal.MetalLookAndFeel";
|
return getLookAndFeel().getDefaults();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the default values for this look and feel.
|
|
||||||
*/
|
|
||||||
static UIDefaults getDefaults()
|
|
||||||
{
|
|
||||||
return getLookAndFeel().getDefaults();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a dimension from the defaults table.
|
|
||||||
*/
|
|
||||||
static Dimension getDimension(Object key)
|
|
||||||
{
|
|
||||||
System.out.println("UIManager.getDim");
|
|
||||||
return new Dimension(200,100);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a dimension from the defaults table.
|
||||||
|
*/
|
||||||
|
static Dimension getDimension(Object key)
|
||||||
|
{
|
||||||
|
System.out.println("UIManager.getDim");
|
||||||
|
return new Dimension(200,100);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves a font from the defaults table of the current
|
* Retrieves a font from the defaults table of the current
|
||||||
|
@ -189,34 +195,35 @@ public class UIManager implements Serializable
|
||||||
return (Font) getLookAndFeel().getDefaults().get(key);
|
return (Font) getLookAndFeel().getDefaults().get(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Icon getIcon(Object key)
|
static Icon getIcon(Object key)
|
||||||
// Returns an Icon from the defaults table.
|
// Returns an Icon from the defaults table.
|
||||||
{
|
{
|
||||||
return (Icon) getLookAndFeel().getDefaults().get(key);
|
return (Icon) getLookAndFeel().getDefaults().get(key);
|
||||||
}
|
}
|
||||||
static Insets getInsets(Object key)
|
|
||||||
// Returns an Insets object from the defaults table.
|
|
||||||
{
|
|
||||||
return (Insets) getLookAndFeel().getDefaults().getInsets(key);
|
|
||||||
}
|
|
||||||
|
|
||||||
static LookAndFeelInfo[] getInstalledLookAndFeels()
|
static Insets getInsets(Object key)
|
||||||
{
|
// Returns an Insets object from the defaults table.
|
||||||
return installed;
|
{
|
||||||
}
|
return (Insets) getLookAndFeel().getDefaults().getInsets(key);
|
||||||
|
}
|
||||||
|
|
||||||
static int getInt(Object key)
|
static LookAndFeelInfo[] getInstalledLookAndFeels()
|
||||||
{
|
{
|
||||||
Integer x = (Integer) getLookAndFeel().getDefaults().get(key);
|
return installed;
|
||||||
if (x == null)
|
}
|
||||||
return 0;
|
|
||||||
return x.intValue();
|
|
||||||
}
|
|
||||||
static LookAndFeel getLookAndFeel()
|
|
||||||
{
|
|
||||||
return look_and_feel;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
static int getInt(Object key)
|
||||||
|
{
|
||||||
|
Integer x = (Integer) getLookAndFeel().getDefaults().get(key);
|
||||||
|
if (x == null)
|
||||||
|
return 0;
|
||||||
|
return x.intValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
static LookAndFeel getLookAndFeel()
|
||||||
|
{
|
||||||
|
return look_and_feel;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the <code>UIDefaults</code> table of the currently active
|
* Returns the <code>UIDefaults</code> table of the currently active
|
||||||
|
@ -227,73 +234,67 @@ public class UIManager implements Serializable
|
||||||
return getLookAndFeel().getDefaults();
|
return getLookAndFeel().getDefaults();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static String getString(Object key)
|
||||||
|
// Returns a string from the defaults table.
|
||||||
|
{
|
||||||
|
return (String) getLookAndFeel().getDefaults().get(key);
|
||||||
|
}
|
||||||
|
|
||||||
static String getString(Object key)
|
static String getSystemLookAndFeelClassName()
|
||||||
// Returns a string from the defaults table.
|
// Returns the name of the LookAndFeel class that implements the native systems look and feel if there is one, otherwise the name of the default cross platform LookAndFeel class.
|
||||||
{
|
{
|
||||||
return (String) getLookAndFeel().getDefaults().get(key);
|
return getCrossPlatformLookAndFeelClassName();
|
||||||
}
|
}
|
||||||
static String getSystemLookAndFeelClassName()
|
|
||||||
// Returns the name of the LookAndFeel class that implements the native systems look and feel if there is one, otherwise the name of the default cross platform LookAndFeel class.
|
|
||||||
{
|
|
||||||
return getCrossPlatformLookAndFeelClassName();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public static ComponentUI getUI(JComponent target)
|
||||||
|
// Returns the L&F object that renders the target component.
|
||||||
|
{
|
||||||
|
ComponentUI ui = getDefaults().getUI(target);
|
||||||
|
//System.out.println("GET-UI-> " + ui + ", for " + target);
|
||||||
|
return ui;
|
||||||
|
}
|
||||||
|
|
||||||
public static ComponentUI getUI(JComponent target)
|
public static void installLookAndFeel(String name, String className)
|
||||||
// Returns the L&F object that renders the target component.
|
// Creates a new look and feel and adds it to the current array.
|
||||||
{
|
{
|
||||||
ComponentUI ui = getDefaults().getUI(target);
|
}
|
||||||
//System.out.println("GET-UI-> " + ui + ", for " + target);
|
|
||||||
return ui;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public static void installLookAndFeel(LookAndFeelInfo info)
|
||||||
|
// Adds the specified look and feel to the current array and then calls setInstalledLookAndFeels(javax.swing.UIManager.LookAndFeelInfo[]).
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public static void installLookAndFeel(String name, String className)
|
public static Object put(Object key, Object value)
|
||||||
// Creates a new look and feel and adds it to the current array.
|
// Stores an object in the defaults table.
|
||||||
{
|
{
|
||||||
}
|
return getLookAndFeel().getDefaults().put(key,value);
|
||||||
public static void installLookAndFeel(LookAndFeelInfo info)
|
}
|
||||||
// Adds the specified look and feel to the current array and then calls setInstalledLookAndFeels(javax.swing.UIManager.LookAndFeelInfo[]).
|
|
||||||
{
|
|
||||||
}
|
|
||||||
public static Object put(Object key, Object value)
|
|
||||||
// Stores an object in the defaults table.
|
|
||||||
{
|
|
||||||
return getLookAndFeel().getDefaults().put(key,value);
|
|
||||||
}
|
|
||||||
public static void removePropertyChangeListener(PropertyChangeListener listener)
|
|
||||||
// Remove a PropertyChangeListener from the listener list.
|
|
||||||
{
|
|
||||||
}
|
|
||||||
public static void setInstalledLookAndFeels(UIManager.LookAndFeelInfo[] infos)
|
|
||||||
// Replaces the current array of installed LookAndFeelInfos.
|
|
||||||
{
|
|
||||||
}
|
|
||||||
public static void setLookAndFeel(LookAndFeel newLookAndFeel)
|
|
||||||
{
|
|
||||||
if (look_and_feel != null)
|
|
||||||
look_and_feel.uninitialize();
|
|
||||||
|
|
||||||
// Set the current default look and feel using a LookAndFeel object.
|
public static void setInstalledLookAndFeels(UIManager.LookAndFeelInfo[] infos)
|
||||||
look_and_feel = newLookAndFeel;
|
// Replaces the current array of installed LookAndFeelInfos.
|
||||||
look_and_feel.initialize();
|
{
|
||||||
|
}
|
||||||
|
|
||||||
// revalidate();
|
public static void setLookAndFeel(LookAndFeel newLookAndFeel)
|
||||||
// repaint();
|
{
|
||||||
}
|
if (look_and_feel != null)
|
||||||
|
look_and_feel.uninitialize();
|
||||||
|
|
||||||
public static void setLookAndFeel(String className)
|
// Set the current default look and feel using a LookAndFeel object.
|
||||||
throws ClassNotFoundException,
|
look_and_feel = newLookAndFeel;
|
||||||
InstantiationException,
|
look_and_feel.initialize();
|
||||||
IllegalAccessException,
|
|
||||||
UnsupportedLookAndFeelException
|
|
||||||
{
|
|
||||||
// Set the current default look and feel using a class name.
|
|
||||||
Class c = Class.forName(className);
|
|
||||||
LookAndFeel a = (LookAndFeel) c.newInstance(); // throws class-cast-exception
|
|
||||||
setLookAndFeel(a);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
//revalidate();
|
||||||
|
//repaint();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setLookAndFeel (String className)
|
||||||
|
throws ClassNotFoundException, InstantiationException, IllegalAccessException,
|
||||||
|
UnsupportedLookAndFeelException
|
||||||
|
{
|
||||||
|
// Set the current default look and feel using a class name.
|
||||||
|
Class c = Class.forName(className);
|
||||||
|
LookAndFeel a = (LookAndFeel) c.newInstance(); // throws class-cast-exception
|
||||||
|
setLookAndFeel(a);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,90 +52,90 @@ import javax.swing.event.EventListenerList;
|
||||||
public class DefaultColorSelectionModel
|
public class DefaultColorSelectionModel
|
||||||
implements ColorSelectionModel, Serializable
|
implements ColorSelectionModel, Serializable
|
||||||
{
|
{
|
||||||
static final long serialVersionUID = 580150227676302096L;
|
private static final long serialVersionUID = -8117143602864778804L;
|
||||||
|
|
||||||
//-------------------------------------------------------------
|
private Color selectedColor;
|
||||||
// Variables --------------------------------------------------
|
|
||||||
//-------------------------------------------------------------
|
|
||||||
|
|
||||||
/**
|
protected transient ChangeEvent changeEvent = new ChangeEvent (this);
|
||||||
* changeEvent
|
protected EventListenerList listenerList = new EventListenerList ();
|
||||||
*/
|
|
||||||
protected transient ChangeEvent changeEvent;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* listenerList
|
* Creates a new color selection model.
|
||||||
*/
|
*/
|
||||||
protected EventListenerList listenerList;
|
public DefaultColorSelectionModel()
|
||||||
|
{
|
||||||
|
this (Color.white);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* selectedColor
|
* Creates a new color selection model with a given selected color.
|
||||||
*/
|
*
|
||||||
private Color selectedColor;
|
* @param color The selected color.
|
||||||
|
*/
|
||||||
|
public DefaultColorSelectionModel (Color color)
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
this.selectedColor = color;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the selected color.
|
||||||
|
*
|
||||||
|
* @return The selected color.
|
||||||
|
*/
|
||||||
|
public Color getSelectedColor()
|
||||||
|
{
|
||||||
|
return selectedColor;
|
||||||
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------
|
/**
|
||||||
// Initialization ---------------------------------------------
|
* @param color The color to set.
|
||||||
//-------------------------------------------------------------
|
*/
|
||||||
|
public void setSelectedColor (Color color)
|
||||||
|
{
|
||||||
|
this.selectedColor = color;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor DefaultColorSelectionModel
|
* Adds a listener to this model.
|
||||||
*/
|
*
|
||||||
public DefaultColorSelectionModel() {
|
* @param listener The listener to add.
|
||||||
// TODO
|
*/
|
||||||
} // DefaultColorSelectionModel()
|
public void addChangeListener (ChangeListener listener)
|
||||||
|
{
|
||||||
|
listenerList.add (ChangeListener.class, listener);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor DefaultColorSelectionModel
|
* Removes a listener from this model.
|
||||||
* @param color TODO
|
*
|
||||||
*/
|
* @param listener The listener to remove.
|
||||||
public DefaultColorSelectionModel(Color color) {
|
*/
|
||||||
// TODO
|
public void removeChangeListener (ChangeListener listener)
|
||||||
} // DefaultColorSelectionModel()
|
{
|
||||||
|
listenerList.remove (ChangeListener.class, listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns all currently added <code>ChangeListener</code> objects.
|
||||||
|
*
|
||||||
|
* @return Array of <code>ChangeListener</code> objects.
|
||||||
|
*/
|
||||||
|
public ChangeListener[] getChangeListeners()
|
||||||
|
{
|
||||||
|
return (ChangeListener[]) listenerList.getListeners (ChangeListener.class);
|
||||||
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------
|
/**
|
||||||
// Methods ----------------------------------------------------
|
* Calls all the <code>stateChanged()</code> method of all added
|
||||||
//-------------------------------------------------------------
|
* <code>ChangeListener</code> objects with <code>changeEvent</code>
|
||||||
|
* as argument.
|
||||||
|
*/
|
||||||
|
protected void fireStateChanged()
|
||||||
|
{
|
||||||
|
ChangeListener[] listeners = getChangeListeners();
|
||||||
|
|
||||||
/**
|
for (int i = 0; i < listeners.length; i++)
|
||||||
* getSelectedColor
|
listeners [i].stateChanged (changeEvent);
|
||||||
* @returns Color
|
}
|
||||||
*/
|
}
|
||||||
public Color getSelectedColor() {
|
|
||||||
return null; // TODO
|
|
||||||
} // getSelectedColor()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* setSelectedColor
|
|
||||||
* @param color TODO
|
|
||||||
*/
|
|
||||||
public void setSelectedColor(Color color) {
|
|
||||||
// TODO
|
|
||||||
} // setSelectedColor()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* addChangeListener
|
|
||||||
* @param listener TODO
|
|
||||||
*/
|
|
||||||
public void addChangeListener(ChangeListener listener) {
|
|
||||||
// TODO
|
|
||||||
} // addChangeListener()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* removeChangeListener
|
|
||||||
* @param listener TODO
|
|
||||||
*/
|
|
||||||
public void removeChangeListener(ChangeListener listener) {
|
|
||||||
// TODO
|
|
||||||
} // removeChangeListener()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* fireStateChanged
|
|
||||||
*/
|
|
||||||
protected void fireStateChanged() {
|
|
||||||
// TODO
|
|
||||||
} // fireStateChanged()
|
|
||||||
|
|
||||||
|
|
||||||
} // DefaultColorSelectionModel
|
|
||||||
|
|
|
@ -50,9 +50,9 @@ public class AncestorEvent extends AWTEvent
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = -8079801679695605002L;
|
private static final long serialVersionUID = -8079801679695605002L;
|
||||||
|
|
||||||
public static final int ANCESTOR_ADDED = 0;
|
public static final int ANCESTOR_ADDED = 1;
|
||||||
public static final int ANCESTOR_MOVED = 1;
|
|
||||||
public static final int ANCESTOR_REMOVED = 2;
|
public static final int ANCESTOR_REMOVED = 2;
|
||||||
|
public static final int ANCESTOR_MOVED = 3;
|
||||||
|
|
||||||
private JComponent sourceComponent;
|
private JComponent sourceComponent;
|
||||||
private Container ancestor;
|
private Container ancestor;
|
||||||
|
|
|
@ -81,7 +81,7 @@ public class InternalFrameEvent extends AWTEvent
|
||||||
/**
|
/**
|
||||||
* Internal frame iconified event
|
* Internal frame iconified event
|
||||||
*/
|
*/
|
||||||
public static final int INTERNAL_FRAME_ICONIFIED = 2552;
|
public static final int INTERNAL_FRAME_ICONIFIED = 25552;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal frame last event
|
* Internal frame last event
|
||||||
|
@ -91,7 +91,7 @@ public class InternalFrameEvent extends AWTEvent
|
||||||
/**
|
/**
|
||||||
* Internal frame opened event
|
* Internal frame opened event
|
||||||
*/
|
*/
|
||||||
public static final int INTERNAL_FRAME_OPENED = 25550;
|
public static final int INTERNAL_FRAME_OPENED = 25549;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a <code>JInternalFrameEvent</code> object.
|
* Creates a <code>JInternalFrameEvent</code> object.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue