bugged
stringlengths
6
599k
fixed
stringlengths
6
40.8M
__index_level_0__
int64
0
3.24M
public void setStatus(byte attr,byte value,String s) { Graphics2D g2d = getWritingArea(); statusString = s; if (g2d == null) return; try { g2d.setColor(colorBg); g2d.fill(sArea); float Y = ((int)sArea.getY() + fmHeight)- (lm.getLeading() + lm.getDescent()); switch (attr) { case STATUS_SYSTEM: if (value == STATUS_VALUE_ON) { statusXSystem =true; g2d.setColor(colorWhite); if (s != null) g2d.drawString(s,(float)sArea.getX(),Y); else g2d.drawString(xSystem,(float)sArea.getX(),Y); } else statusXSystem = false; break; case STATUS_ERROR_CODE: if (value == STATUS_VALUE_ON) { g2d.setColor(colorRed); if (s != null) g2d.drawString(s,(float)sArea.getX(),Y); else g2d.drawString(xError,(float)sArea.getX(),Y); statusErrorCode = true; setKeyboardLocked(true); Toolkit.getDefaultToolkit().beep(); } else { statusErrorCode = false; setKeyboardLocked(false); homePos = saveHomePos; saveHomePos = 0; pendingInsert = false; } break; } updateImage(sArea.getBounds()); g2d.dispose(); } catch (Exception e) { System.out.println(" setStatus " + e.getMessage()); } }
public void setStatus(byte attr,byte value,String s) { Graphics2D g2d = getWritingArea(); statusString = s; if (g2d == null) return; try { g2d.setColor(colorBg); g2d.fill(sArea); float Y = ((int)sArea.getY() + fmHeight)- (lm.getLeading() + lm.getDescent()); switch (attr) { case STATUS_SYSTEM: if (value == STATUS_VALUE_ON) { statusXSystem =true; g2d.setColor(colorWhite); if (s != null) g2d.drawString(s,(float)sArea.getX(),Y); else g2d.drawString(xSystem,(float)sArea.getX(),Y); } else statusXSystem = false; break; case STATUS_ERROR_CODE: if (value == STATUS_VALUE_ON) { g2d.setColor(colorRed); if (s != null) g2d.drawString(s,(float)sArea.getX(),Y); else g2d.drawString(xError,(float)sArea.getX(),Y); statusErrorCode = true; setKeyboardLocked(true); Toolkit.getDefaultToolkit().beep(); } else { statusErrorCode = false; setKeyboardLocked(false); homePos = saveHomePos; saveHomePos = 0; pendingInsert = false; } break; } updateImage(sArea.getBounds()); g2d.dispose(); } catch (Exception e) { System.out.println(" setStatus " + e.getMessage()); } }
3,042
public void setStatus(byte attr,byte value,String s) { Graphics2D g2d = getWritingArea(); statusString = s; if (g2d == null) return; try { g2d.setColor(colorBg); g2d.fill(sArea); float Y = ((int)sArea.getY() + fmHeight)- (lm.getLeading() + lm.getDescent()); switch (attr) { case STATUS_SYSTEM: if (value == STATUS_VALUE_ON) { statusXSystem =true; g2d.setColor(colorWhite); if (s != null) g2d.drawString(s,(float)sArea.getX(),Y); else g2d.drawString(xSystem,(float)sArea.getX(),Y); } else statusXSystem = false; break; case STATUS_ERROR_CODE: if (value == STATUS_VALUE_ON) { g2d.setColor(colorRed); if (s != null) g2d.drawString(s,(float)sArea.getX(),Y); else g2d.drawString(xError,(float)sArea.getX(),Y); statusErrorCode = true; setKeyboardLocked(true); Toolkit.getDefaultToolkit().beep(); } else { statusErrorCode = false; setKeyboardLocked(false); homePos = saveHomePos; saveHomePos = 0; pendingInsert = false; } break; } updateImage(sArea.getBounds()); g2d.dispose(); } catch (Exception e) { System.out.println(" setStatus " + e.getMessage()); } }
public void setStatus(byte attr,byte value,String s) { Graphics2D g2d = getWritingArea(); statusString = s; if (g2d == null) return; try { g2d.setColor(colorBg); g2d.fill(sArea); float Y = ((int)sArea.getY() + fmHeight)- (lm.getLeading() + lm.getDescent()); switch (attr) { case STATUS_SYSTEM: if (value == STATUS_VALUE_ON) { statusXSystem =true; g2d.setColor(colorWhite); if (s != null) g2d.drawString(s,(float)sArea.getX(),Y); else g2d.drawString(xSystem,(float)sArea.getX(),Y); } else statusXSystem = false; break; case STATUS_ERROR_CODE: if (value == STATUS_VALUE_ON) { g2d.setColor(colorRed); if (s != null) g2d.drawString(s,(float)sArea.getX(),Y); else g2d.drawString(xError,(float)sArea.getX(),Y); statusErrorCode = true; setKeyboardLocked(true); Toolkit.getDefaultToolkit().beep(); } else { statusErrorCode = false; setKeyboardLocked(false); homePos = saveHomePos; saveHomePos = 0; pendingInsert = false; } break; } updateImage(sArea.getBounds()); g2d.dispose(); } catch (Exception e) { System.out.println(" setStatus " + e.getMessage()); } }
3,043
protected void resolve() throws PluginException { if (getDeclaringPluginDescriptor().getPluginRegistry().getPluginDescriptor(plugin) == null) { throw new PluginException("Unknown plugin " + plugin + " in import of " + getDeclaringPluginDescriptor().getId()); } }
protected void resolve(PluginRegistryModel registry) throws PluginException { if (getDeclaringPluginDescriptor().getPluginRegistry().getPluginDescriptor(plugin) == null) { throw new PluginException("Unknown plugin " + plugin + " in import of " + getDeclaringPluginDescriptor().getId()); } }
3,045
protected void resolve() throws PluginException { if (getDeclaringPluginDescriptor().getPluginRegistry().getPluginDescriptor(plugin) == null) { throw new PluginException("Unknown plugin " + plugin + " in import of " + getDeclaringPluginDescriptor().getId()); } }
protected void resolve() throws PluginException { if (getDeclaringPluginDescriptor().getPluginRegistry().getPluginDescriptor(plugin) == null) { throw new PluginException("Unknown plugin " + plugin + " in import of " + getDeclaringPluginDescriptor().getId()); } }
3,046
protected void unresolve() throws PluginException { // Nothing to do }
protected void unresolve() throws PluginException { // Nothing to do }
3,047
public int getMinimumDividerLocation(JSplitPane jc) { int value = layoutManager.getInitialLocation(jc.getInsets()); if (layoutManager.components[0] != null) value += layoutManager.minimumSizeOfComponent(0); return value; }
public int getMinimumDividerLocation(JSplitPane jc) { int value = layoutManager.getInitialLocation(jc.getInsets()); if (layoutManager.components[0] != null) value += layoutManager.minimumSizeOfComponent(0); return value; }
3,048
public static String getLocalizedString(Locale inLocale, String key, String name, boolean checkEnglish, boolean checkRoot) { String localizedString; Hashtable table; if (key.equals("")) return ""; /* Localize to inLocale */ try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", inLocale).getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } /* Localize to default locale */ if (localizedString == null) { try { ResourceBundle bundle; bundle = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation"); table = (Hashtable) bundle.getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Localize to English */ if (localizedString == null && checkEnglish) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", Locale.ENGLISH).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return unlocalized version */ if (localizedString == null && checkRoot) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", new Locale("","","")).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return original input string */ if (localizedString == null) { localizedString = key; } return localizedString; }
public static String getLocalizedString(Locale inLocale, String key, String name, boolean checkEnglish, boolean checkRoot) { String localizedString; String property; if (key.equals("")) return ""; /* Localize to inLocale */ try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", inLocale).getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } /* Localize to default locale */ if (localizedString == null) { try { ResourceBundle bundle; bundle = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation"); table = (Hashtable) bundle.getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Localize to English */ if (localizedString == null && checkEnglish) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", Locale.ENGLISH).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return unlocalized version */ if (localizedString == null && checkRoot) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", new Locale("","","")).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return original input string */ if (localizedString == null) { localizedString = key; } return localizedString; }
3,049
public static String getLocalizedString(Locale inLocale, String key, String name, boolean checkEnglish, boolean checkRoot) { String localizedString; Hashtable table; if (key.equals("")) return ""; /* Localize to inLocale */ try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", inLocale).getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } /* Localize to default locale */ if (localizedString == null) { try { ResourceBundle bundle; bundle = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation"); table = (Hashtable) bundle.getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Localize to English */ if (localizedString == null && checkEnglish) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", Locale.ENGLISH).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return unlocalized version */ if (localizedString == null && checkRoot) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", new Locale("","","")).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return original input string */ if (localizedString == null) { localizedString = key; } return localizedString; }
public static String getLocalizedString(Locale inLocale, String key, String name, boolean checkEnglish, boolean checkRoot) { String localizedString; Hashtable table; if (key.equals("")) return ""; /* Localize to inLocale */ try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", inLocale).getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } /* Localize to default locale */ if (localizedString == null) { try { ResourceBundle bundle; bundle = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation"); localizedString = bundle.getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Localize to English */ if (localizedString == null && checkEnglish) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", Locale.ENGLISH).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return unlocalized version */ if (localizedString == null && checkRoot) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", new Locale("","","")).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return original input string */ if (localizedString == null) { localizedString = key; } return localizedString; }
3,050
public static String getLocalizedString(Locale inLocale, String key, String name, boolean checkEnglish, boolean checkRoot) { String localizedString; Hashtable table; if (key.equals("")) return ""; /* Localize to inLocale */ try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", inLocale).getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } /* Localize to default locale */ if (localizedString == null) { try { ResourceBundle bundle; bundle = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation"); table = (Hashtable) bundle.getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Localize to English */ if (localizedString == null && checkEnglish) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", Locale.ENGLISH).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return unlocalized version */ if (localizedString == null && checkRoot) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", new Locale("","","")).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return original input string */ if (localizedString == null) { localizedString = key; } return localizedString; }
public static String getLocalizedString(Locale inLocale, String key, String name, boolean checkEnglish, boolean checkRoot) { String localizedString; Hashtable table; if (key.equals("")) return ""; /* Localize to inLocale */ try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", inLocale).getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } /* Localize to default locale */ if (localizedString == null) { try { ResourceBundle bundle; bundle = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation"); table = (Hashtable) bundle.getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Localize to English */ if (localizedString == null && checkEnglish) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", Locale.ENGLISH).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return unlocalized version */ if (localizedString == null && checkRoot) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", new Locale("","","")).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return original input string */ if (localizedString == null) { localizedString = key; } return localizedString; }
3,051
public static String getLocalizedString(Locale inLocale, String key, String name, boolean checkEnglish, boolean checkRoot) { String localizedString; Hashtable table; if (key.equals("")) return ""; /* Localize to inLocale */ try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", inLocale).getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } /* Localize to default locale */ if (localizedString == null) { try { ResourceBundle bundle; bundle = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation"); table = (Hashtable) bundle.getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Localize to English */ if (localizedString == null && checkEnglish) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", Locale.ENGLISH).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return unlocalized version */ if (localizedString == null && checkRoot) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", new Locale("","","")).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return original input string */ if (localizedString == null) { localizedString = key; } return localizedString; }
public static String getLocalizedString(Locale inLocale, String key, String name, boolean checkEnglish, boolean checkRoot) { String localizedString; Hashtable table; if (key.equals("")) return ""; /* Localize to inLocale */ try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", inLocale).getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } /* Localize to default locale */ if (localizedString == null) { try { ResourceBundle bundle; bundle = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation"); table = (Hashtable) bundle.getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Localize to English */ if (localizedString == null && checkEnglish) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", Locale.ENGLISH).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return unlocalized version */ if (localizedString == null && checkRoot) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", new Locale("","","")).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return original input string */ if (localizedString == null) { localizedString = key; } return localizedString; }
3,052
public static String getLocalizedString(Locale inLocale, String key, String name, boolean checkEnglish, boolean checkRoot) { String localizedString; Hashtable table; if (key.equals("")) return ""; /* Localize to inLocale */ try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", inLocale).getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } /* Localize to default locale */ if (localizedString == null) { try { ResourceBundle bundle; bundle = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation"); table = (Hashtable) bundle.getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Localize to English */ if (localizedString == null && checkEnglish) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", Locale.ENGLISH).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return unlocalized version */ if (localizedString == null && checkRoot) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", new Locale("","","")).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return original input string */ if (localizedString == null) { localizedString = key; } return localizedString; }
public static String getLocalizedString(Locale inLocale, String key, String name, boolean checkEnglish, boolean checkRoot) { String localizedString; Hashtable table; if (key.equals("")) return ""; /* Localize to inLocale */ try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", inLocale).getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } /* Localize to default locale */ if (localizedString == null) { try { ResourceBundle bundle; bundle = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation"); localizedString = bundle.getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Localize to English */ if (localizedString == null && checkEnglish) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", Locale.ENGLISH).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return unlocalized version */ if (localizedString == null && checkRoot) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", new Locale("","","")).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return original input string */ if (localizedString == null) { localizedString = key; } return localizedString; }
3,053
public static String getLocalizedString(Locale inLocale, String key, String name, boolean checkEnglish, boolean checkRoot) { String localizedString; Hashtable table; if (key.equals("")) return ""; /* Localize to inLocale */ try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", inLocale).getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } /* Localize to default locale */ if (localizedString == null) { try { ResourceBundle bundle; bundle = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation"); table = (Hashtable) bundle.getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Localize to English */ if (localizedString == null && checkEnglish) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", Locale.ENGLISH).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return unlocalized version */ if (localizedString == null && checkRoot) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", new Locale("","","")).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return original input string */ if (localizedString == null) { localizedString = key; } return localizedString; }
public static String getLocalizedString(Locale inLocale, String key, String name, boolean checkEnglish, boolean checkRoot) { String localizedString; Hashtable table; if (key.equals("")) return ""; /* Localize to inLocale */ try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", inLocale).getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } /* Localize to default locale */ if (localizedString == null) { try { ResourceBundle bundle; bundle = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation"); table = (Hashtable) bundle.getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Localize to English */ if (localizedString == null && checkEnglish) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", Locale.ENGLISH).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return unlocalized version */ if (localizedString == null && checkRoot) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", new Locale("","","")).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return original input string */ if (localizedString == null) { localizedString = key; } return localizedString; }
3,054
public static String getLocalizedString(Locale inLocale, String key, String name, boolean checkEnglish, boolean checkRoot) { String localizedString; Hashtable table; if (key.equals("")) return ""; /* Localize to inLocale */ try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", inLocale).getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } /* Localize to default locale */ if (localizedString == null) { try { ResourceBundle bundle; bundle = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation"); table = (Hashtable) bundle.getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Localize to English */ if (localizedString == null && checkEnglish) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", Locale.ENGLISH).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return unlocalized version */ if (localizedString == null && checkRoot) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", new Locale("","","")).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return original input string */ if (localizedString == null) { localizedString = key; } return localizedString; }
public static String getLocalizedString(Locale inLocale, String key, String name, boolean checkEnglish, boolean checkRoot) { String localizedString; Hashtable table; if (key.equals("")) return ""; /* Localize to inLocale */ try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", inLocale).getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } /* Localize to default locale */ if (localizedString == null) { try { ResourceBundle bundle; bundle = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation"); localizedString = bundle.getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Localize to English */ if (localizedString == null && checkEnglish) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", Locale.ENGLISH).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return unlocalized version */ if (localizedString == null && checkRoot) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", new Locale("","","")).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return original input string */ if (localizedString == null) { localizedString = key; } return localizedString; }
3,055
public static String getLocalizedString(Locale inLocale, String key, String name, boolean checkEnglish, boolean checkRoot) { String localizedString; Hashtable table; if (key.equals("")) return ""; /* Localize to inLocale */ try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", inLocale).getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } /* Localize to default locale */ if (localizedString == null) { try { ResourceBundle bundle; bundle = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation"); table = (Hashtable) bundle.getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Localize to English */ if (localizedString == null && checkEnglish) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", Locale.ENGLISH).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return unlocalized version */ if (localizedString == null && checkRoot) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", new Locale("","","")).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return original input string */ if (localizedString == null) { localizedString = key; } return localizedString; }
public static String getLocalizedString(Locale inLocale, String key, String name, boolean checkEnglish, boolean checkRoot) { String localizedString; Hashtable table; if (key.equals("")) return ""; /* Localize to inLocale */ try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", inLocale).getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } /* Localize to default locale */ if (localizedString == null) { try { ResourceBundle bundle; bundle = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation"); table = (Hashtable) bundle.getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Localize to English */ if (localizedString == null && checkEnglish) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", Locale.ENGLISH).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return unlocalized version */ if (localizedString == null && checkRoot) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", new Locale("","","")).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return original input string */ if (localizedString == null) { localizedString = key; } return localizedString; }
3,056
private void encodeDer() { ArrayList name = new ArrayList(components.size()); for (Iterator it = components.iterator(); it.hasNext(); ) { Map m = (Map) it.next(); if (m.isEmpty()) continue; Set rdn = new HashSet(); for (Iterator it2 = m.entrySet().iterator(); it2.hasNext(); ) { Map.Entry e = (Map.Entry) it.next(); ArrayList atav = new ArrayList(2); atav.add(new DERValue(DER.OBJECT_IDENTIFIER, e.getKey())); atav.add(new DERValue(DER.UTF8_STRING, e.getValue())); rdn.add(new DERValue(DER.SEQUENCE|DER.CONSTRUCTED, atav)); } name.add(new DERValue(DER.SET|DER.CONSTRUCTED, rdn)); } DERValue val = new DERValue(DER.SEQUENCE|DER.CONSTRUCTED, name); encoded = val.getEncoded(); }
private void encodeDer() { ArrayList name = new ArrayList(components.size()); for (Iterator it = components.iterator(); it.hasNext(); ) { Map m = (Map) it.next(); if (m.isEmpty()) continue; Set rdn = new HashSet(); for (Iterator it2 = m.entrySet().iterator(); it2.hasNext(); ) { Map.Entry e = (Map.Entry) it2.next(); ArrayList atav = new ArrayList(2); atav.add(new DERValue(DER.OBJECT_IDENTIFIER, e.getKey())); atav.add(new DERValue(DER.UTF8_STRING, e.getValue())); rdn.add(new DERValue(DER.SEQUENCE|DER.CONSTRUCTED, atav)); } name.add(new DERValue(DER.SET|DER.CONSTRUCTED, rdn)); } DERValue val = new DERValue(DER.SEQUENCE|DER.CONSTRUCTED, name); encoded = val.getEncoded(); }
3,057
private String readAttributeType(Reader in) throws IOException { StringBuffer buf = new StringBuffer(); int ch; while ((ch = in.read()) != '=') { if (ch == -1) { if (buf.length() > 0) throw new EOFException(); return null; } if (ch > 127) throw new IOException("Invalid char: " + (char) ch); if (Character.isLetterOrDigit((char) ch) || ch == '-' || ch == '.') buf.append((char) ch); else throw new IOException("Invalid char: " + (char) ch); } return buf.toString(); }
private String readAttributeType(Reader in) throws IOException { StringBuffer buf = new StringBuffer(); int ch; while ((ch = in.read()) != '=') { if (ch == -1) { if (buf.length() > 0) throw new EOFException("partial name read: " + buf); return null; } if (ch > 127) throw new IOException("Invalid char: " + (char) ch); if (Character.isLetterOrDigit((char) ch) || ch == '-' || ch == '.') buf.append((char) ch); else throw new IOException("Invalid char: " + (char) ch); } return buf.toString(); }
3,059
private String readAttributeValue(Reader in) throws IOException { StringBuffer buf = new StringBuffer(); int ch = in.read(); if (ch == '#') { while (true) { ch = in.read(); if (('a' <= ch && ch <= 'f') || ('A' <= ch && ch <= 'F') || Character.isDigit((char) ch)) buf.append((char) ch); else if (ch == '+' || ch == ',') { sep = ch; String hex = buf.toString(); return new String(toByteArray(hex)); } else throw new IOException("illegal character: " + (char) ch); } } else if (ch == '"') { while (true) { ch = in.read(); if (ch == '"') break; else if (ch == '\\') { ch = in.read(); if (ch == -1) throw new EOFException(); if (('a' <= ch && ch <= 'f') || ('A' <= ch && ch <= 'F') || Character.isDigit((char) ch)) { int i = Character.digit((char) ch, 16) << 4; ch = in.read(); if (!(('a' <= ch && ch <= 'f') || ('A' <= ch && ch <= 'F') || Character.isDigit((char) ch))) throw new IOException("illegal hex char"); i |= Character.digit((char) ch, 16); buf.append((char) i); } else buf.append((char) ch); } else buf.append((char) ch); } sep = in.read(); if (sep != '+' || sep != ',') throw new IOException("illegal character: " + (char) ch); return buf.toString(); } else { while (true) { switch (ch) { case '+': case ',': sep = ch; return buf.toString(); case '\\': ch = in.read(); if (ch == -1) throw new EOFException(); if (('a' <= ch && ch <= 'f') || ('A' <= ch && ch <= 'F') || Character.isDigit((char) ch)) { int i = Character.digit((char) ch, 16) << 4; ch = in.read(); if (!(('a' <= ch && ch <= 'f') || ('A' <= ch && ch <= 'F') || Character.isDigit((char) ch))) throw new IOException("illegal hex char"); i |= Character.digit((char) ch, 16); buf.append((char) i); } else buf.append((char) ch); break; case '=': case '<': case '>': case '#': case ';': throw new IOException("illegal character: " + (char) ch); case -1: throw new EOFException(); default: buf.append((char) ch); } } } }
private String readAttributeValue(Reader in) throws IOException { StringBuffer buf = new StringBuffer(); int ch = in.read(); if (ch == '#') { while (true) { ch = in.read(); if (('a' <= ch && ch <= 'f') || ('A' <= ch && ch <= 'F') || Character.isDigit((char) ch)) buf.append((char) ch); else if (ch == '+' || ch == ',') { sep = ch; String hex = buf.toString(); return new String(toByteArray(hex)); } else throw new IOException("illegal character: " + (char) ch); } } else if (ch == '"') { while (true) { ch = in.read(); if (ch == '"') break; else if (ch == '\\') { ch = in.read(); if (ch == -1) sep = -1; return buf.toString (); if (('a' <= ch && ch <= 'f') || ('A' <= ch && ch <= 'F') || Character.isDigit((char) ch)) { int i = Character.digit((char) ch, 16) << 4; ch = in.read(); if (!(('a' <= ch && ch <= 'f') || ('A' <= ch && ch <= 'F') || Character.isDigit((char) ch))) throw new IOException("illegal hex char"); i |= Character.digit((char) ch, 16); buf.append((char) i); } else buf.append((char) ch); } else buf.append((char) ch); } sep = in.read(); if (sep != '+' || sep != ',') throw new IOException("illegal character: " + (char) ch); return buf.toString(); } else { while (true) { switch (ch) { case '+': case ',': sep = ch; return buf.toString(); case '\\': ch = in.read(); if (ch == -1) sep = -1; return buf.toString (); if (('a' <= ch && ch <= 'f') || ('A' <= ch && ch <= 'F') || Character.isDigit((char) ch)) { int i = Character.digit((char) ch, 16) << 4; ch = in.read(); if (!(('a' <= ch && ch <= 'f') || ('A' <= ch && ch <= 'F') || Character.isDigit((char) ch))) throw new IOException("illegal hex char"); i |= Character.digit((char) ch, 16); buf.append((char) i); } else buf.append((char) ch); break; case '=': case '<': case '>': case '#': case ';': throw new IOException("illegal character: " + (char) ch); case -1: sep = -1; return buf.toString (); default: buf.append((char) ch); } } } }
3,060
public AccessibleContext getAccessibleContext() { return null; }
public AccessibleContext getAccessibleContext() { return new AccessibleJList(); }
3,064
public void actionPerformed(ActionEvent e) { Object obj = filelist.getSelectedValue(); if (obj != null) { File f = filechooser.getFileSystemView().createFileObject(obj .toString()); if (filechooser.isTraversable(f) && filechooser.getFileSelectionMode() == JFileChooser.FILES_ONLY) filechooser.setCurrentDirectory(f); else { filechooser.setSelectedFile(f); filechooser.approveSelection(); closeDialog(); } } }
public void actionPerformed(ActionEvent e) { Object obj = new String(parentPath + entry.getText()); if (obj != null) { File f = filechooser.getFileSystemView().createFileObject(obj .toString()); if (filechooser.isTraversable(f) && filechooser.getFileSelectionMode() == JFileChooser.FILES_ONLY) filechooser.setCurrentDirectory(f); else { filechooser.setSelectedFile(f); filechooser.approveSelection(); closeDialog(); } } }
3,065
public void actionPerformed(ActionEvent e) { Object obj = filelist.getSelectedValue(); if (obj != null) { File f = filechooser.getFileSystemView().createFileObject(obj .toString()); if (filechooser.isTraversable(f) && filechooser.getFileSelectionMode() == JFileChooser.FILES_ONLY) filechooser.setCurrentDirectory(f); else { filechooser.setSelectedFile(f); filechooser.approveSelection(); closeDialog(); } } }
public void actionPerformed(ActionEvent e) { Object obj = filelist.getSelectedValue(); if (obj != null) { File f = filechooser.getFileSystemView().createFileObject(obj .toString()); if (filechooser.isTraversable(f) && filechooser.getFileSelectionMode() == JFileChooser.FILES_ONLY) filechooser.setCurrentDirectory(f); else { filechooser.setSelectedFile(f); filechooser.approveSelection(); closeDialog(); } } }
3,066
public void mouseClicked(MouseEvent e) { if (list.getSelectedValue() == null) return; FileSystemView fsv = filechooser.getFileSystemView(); if (timer.isRunning() && list.getSelectedValue().toString().equals(lastSelected.toString())) { File f = fsv.createFileObject(lastSelected.toString()); timer.stop(); if (filechooser.isTraversable(f)) { filechooser.setCurrentDirectory(f); filechooser.rescanCurrentDirectory(); } else { filechooser.setSelectedFile(f); filechooser.approveSelection(); closeDialog(); } } else { File f = fsv.createFileObject(list.getSelectedValue().toString()); if (filechooser.isTraversable(f)) { setDirectorySelected(true); setDirectory(f); } else { setDirectorySelected(false); setDirectory(null); } lastSelected = list.getSelectedValue().toString(); timer.restart(); } }
public void mouseClicked(MouseEvent e) { if (list.getSelectedValue() == null) return; FileSystemView fsv = filechooser.getFileSystemView(); if (timer.isRunning() && list.getSelectedValue().toString().equals(lastSelected.toString())) { File f = fsv.createFileObject(lastSelected.toString()); timer.stop(); if (filechooser.isTraversable(f)) { filechooser.setCurrentDirectory(f); filechooser.rescanCurrentDirectory(); } else { filechooser.setSelectedFile(f); filechooser.approveSelection(); closeDialog(); } } else { File f = fsv.createFileObject(list.getSelectedValue().toString()); if (filechooser.isTraversable(f)) { setDirectorySelected(true); setDirectory(f); } else { setDirectorySelected(false); setDirectory(null); } lastSelected = list.getSelectedValue().toString(); timer.restart(); } }
3,067
public void mouseClicked(MouseEvent e) { if (list.getSelectedValue() == null) return; FileSystemView fsv = filechooser.getFileSystemView(); if (timer.isRunning() && list.getSelectedValue().toString().equals(lastSelected.toString())) { File f = fsv.createFileObject(lastSelected.toString()); timer.stop(); if (filechooser.isTraversable(f)) { filechooser.setCurrentDirectory(f); filechooser.rescanCurrentDirectory(); } else { filechooser.setSelectedFile(f); filechooser.approveSelection(); closeDialog(); } } else { File f = fsv.createFileObject(list.getSelectedValue().toString()); if (filechooser.isTraversable(f)) { setDirectorySelected(true); setDirectory(f); } else { setDirectorySelected(false); setDirectory(null); } lastSelected = list.getSelectedValue().toString(); timer.restart(); } }
public void mouseClicked(MouseEvent e) { if (list.getSelectedValue() == null) return; FileSystemView fsv = filechooser.getFileSystemView(); if (timer.isRunning() && list.getSelectedValue().toString().equals(lastSelected.toString())) { File f = fsv.createFileObject(lastSelected.toString()); timer.stop(); if (filechooser.isTraversable(f)) { filechooser.setCurrentDirectory(f); filechooser.rescanCurrentDirectory(); } else { filechooser.setSelectedFile(f); filechooser.approveSelection(); closeDialog(); } } else { File f = fsv.createFileObject(list.getSelectedValue().toString()); if (filechooser.isTraversable(f)) { setDirectorySelected(true); setDirectory(f); } else { setDirectorySelected(false); setDirectory(null); } lastSelected = list.getSelectedValue().toString(); timer.restart(); } }
3,068
public PropertyChangeListener createPropertyChangeListener(JFileChooser fc) { return new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); } }; }
public PropertyChangeListener createPropertyChangeListener(JFileChooser fc) { return new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); } }; }
3,069
public PropertyChangeListener createPropertyChangeListener(JFileChooser fc) { return new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); } }; }
public PropertyChangeListener createPropertyChangeListener(JFileChooser fc) { return new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); } }; }
3,070
public PropertyChangeListener createPropertyChangeListener(JFileChooser fc) { return new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); } }; }
public PropertyChangeListener createPropertyChangeListener(JFileChooser fc) { return new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); } }; }
3,071
public PropertyChangeListener createPropertyChangeListener(JFileChooser fc) { return new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); } }; }
public PropertyChangeListener createPropertyChangeListener(JFileChooser fc) { return new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); } }; }
3,072
public PropertyChangeListener createPropertyChangeListener(JFileChooser fc) { return new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); } }; }
public PropertyChangeListener createPropertyChangeListener(JFileChooser fc) { return new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); } }; }
3,073
public PropertyChangeListener createPropertyChangeListener(JFileChooser fc) { return new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); } }; }
public PropertyChangeListener createPropertyChangeListener(JFileChooser fc) { return new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); } }; }
3,074
public PropertyChangeListener createPropertyChangeListener(JFileChooser fc) { return new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); } }; }
public PropertyChangeListener createPropertyChangeListener(JFileChooser fc) { return new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); } }; }
3,075
public PropertyChangeListener createPropertyChangeListener(JFileChooser fc) { return new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); } }; }
public PropertyChangeListener createPropertyChangeListener(JFileChooser fc) { return new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); } }; }
3,076
public PropertyChangeListener createPropertyChangeListener(JFileChooser fc) { return new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); } }; }
public PropertyChangeListener createPropertyChangeListener(JFileChooser fc) { return new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); } }; }
3,077
public PropertyChangeListener createPropertyChangeListener(JFileChooser fc) { return new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); } }; }
public PropertyChangeListener createPropertyChangeListener(JFileChooser fc) { return new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); } }; }
3,078
public PropertyChangeListener createPropertyChangeListener(JFileChooser fc) { return new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); } }; }
public PropertyChangeListener createPropertyChangeListener(JFileChooser fc) { return new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); } }; }
3,079
public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); }
public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); }
3,080
public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); }
public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); }
3,081
public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); }
public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); }
3,082
public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); }
public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); }
3,083
public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); }
public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); }
3,084
public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); }
public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); }
3,085
public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); }
public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); }
3,086
public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); }
public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); }
3,087
public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); }
public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); }
3,088
public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); }
public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); }
3,089
public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); }
public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection bug. if (e.getPropertyName().equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals(JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals(JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals(JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals(JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals(JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals(JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals(JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); }
3,090
public void installComponents(JFileChooser fc) { JLabel look = new JLabel("Look In:"); parents = new JComboBox(); parents.setRenderer(new CBLabelRenderer()); boxEntries(); look.setLabelFor(parents); JPanel parentsPanel = new JPanel(); parentsPanel.add(look); parentsPanel.add(parents); JPanel buttonPanel = new JPanel(); upFolderButton = new JButton(); upFolderButton.setIcon(upFolderIcon); buttonPanel.add(upFolderButton); homeFolderButton = new JButton(); homeFolderButton = new JButton(homeFolderIcon); buttonPanel.add(homeFolderButton); newFolderButton = new JButton(); newFolderButton.setIcon(newFolderIcon); buttonPanel.add(newFolderButton); ButtonGroup toggles = new ButtonGroup(); JToggleButton listViewButton = new JToggleButton(); listViewButton.setIcon(listViewIcon); toggles.add(listViewButton); buttonPanel.add(listViewButton); JToggleButton detailsViewButton = new JToggleButton(); detailsViewButton.setIcon(detailsViewIcon); toggles.add(detailsViewButton); buttonPanel.add(detailsViewButton); JPanel topPanel = new JPanel(); topPanel.setLayout(new java.awt.FlowLayout()); topPanel.add(parentsPanel); topPanel.add(buttonPanel); accessoryPanel = new JPanel(); if (filechooser.getAccessory() != null) accessoryPanel.add(filechooser.getAccessory(), BorderLayout.CENTER); filelist = new JList(model); filelist.setVisibleRowCount(6); JScrollPane scrollp = new JScrollPane(filelist); scrollp.setPreferredSize(new Dimension(400, 175)); filelist.setBackground(Color.WHITE); filelist.setLayoutOrientation(JList.VERTICAL_WRAP); filelist.setCellRenderer(new ListLabelRenderer()); GridBagConstraints c = new GridBagConstraints(); c.gridx = 0; c.gridy = 0; c.fill = GridBagConstraints.BOTH; c.weightx = 1; c.weighty = 1; JPanel centrePanel = new JPanel(); centrePanel.setLayout(new GridBagLayout()); centrePanel.add(scrollp, c); c.gridx = 1; centrePanel.add(accessoryPanel, c); JLabel fileNameLabel = new JLabel("File Name:"); JLabel fileTypesLabel = new JLabel("Files of Type:"); JTextField entry = new JTextField(); filters = new JComboBox(); filterEntries(); fileNameLabel.setLabelFor(entry); fileNameLabel.setHorizontalTextPosition(SwingConstants.LEFT); fileTypesLabel.setLabelFor(filters); fileTypesLabel.setHorizontalTextPosition(SwingConstants.LEFT); closePanel = new JPanel(); accept = getApproveButton(filechooser); cancel = new JButton(cancelButtonText); cancel.setMnemonic(cancelButtonMnemonic); cancel.setToolTipText(cancelButtonToolTipText); closePanel.add(accept); closePanel.add(cancel); c.anchor = GridBagConstraints.WEST; c.weighty = 0; c.weightx = 0; c.gridx = 0; bottomPanel = new JPanel(); bottomPanel.setLayout(new GridBagLayout()); bottomPanel.add(fileNameLabel, c); c.gridy = 1; bottomPanel.add(fileTypesLabel, c); c.gridx = 1; c.gridy = 0; c.weightx = 1; c.weighty = 1; bottomPanel.add(entry, c); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.NONE; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); filechooser.setLayout(new BorderLayout()); filechooser.add(topPanel, BorderLayout.NORTH); filechooser.add(centrePanel, BorderLayout.CENTER); filechooser.add(bottomPanel, BorderLayout.SOUTH); }
public void installComponents(JFileChooser fc) { JLabel look = new JLabel("Look In:"); parents = new JComboBox(); parents.setRenderer(new CBLabelRenderer()); boxEntries(); look.setLabelFor(parents); JPanel parentsPanel = new JPanel(); parentsPanel.add(look); parentsPanel.add(parents); JPanel buttonPanel = new JPanel(); upFolderButton = new JButton(); upFolderButton.setIcon(upFolderIcon); buttonPanel.add(upFolderButton); homeFolderButton = new JButton(); homeFolderButton = new JButton(homeFolderIcon); buttonPanel.add(homeFolderButton); newFolderButton = new JButton(); newFolderButton.setIcon(newFolderIcon); buttonPanel.add(newFolderButton); ButtonGroup toggles = new ButtonGroup(); JToggleButton listViewButton = new JToggleButton(); listViewButton.setIcon(listViewIcon); toggles.add(listViewButton); buttonPanel.add(listViewButton); JToggleButton detailsViewButton = new JToggleButton(); detailsViewButton.setIcon(detailsViewIcon); toggles.add(detailsViewButton); buttonPanel.add(detailsViewButton); JPanel topPanel = new JPanel(); topPanel.setLayout(new java.awt.FlowLayout()); topPanel.add(parentsPanel); topPanel.add(buttonPanel); accessoryPanel = new JPanel(); if (filechooser.getAccessory() != null) accessoryPanel.add(filechooser.getAccessory(), BorderLayout.CENTER); filelist = new JList(model); filelist.setVisibleRowCount(6); JScrollPane scrollp = new JScrollPane(filelist); scrollp.setPreferredSize(new Dimension(400, 175)); filelist.setBackground(Color.WHITE); filelist.setLayoutOrientation(JList.VERTICAL_WRAP); filelist.setCellRenderer(new ListLabelRenderer()); GridBagConstraints c = new GridBagConstraints(); c.gridx = 0; c.gridy = 0; c.fill = GridBagConstraints.BOTH; c.weightx = 1; c.weighty = 1; JPanel centrePanel = new JPanel(); centrePanel.setLayout(new GridBagLayout()); centrePanel.add(scrollp, c); c.gridx = 1; centrePanel.add(accessoryPanel, c); JLabel fileNameLabel = new JLabel("File Name:"); JLabel fileTypesLabel = new JLabel("Files of Type:"); entry = new JTextField(); filters = new JComboBox(); filterEntries(); fileNameLabel.setLabelFor(entry); fileNameLabel.setHorizontalTextPosition(SwingConstants.LEFT); fileTypesLabel.setLabelFor(filters); fileTypesLabel.setHorizontalTextPosition(SwingConstants.LEFT); closePanel = new JPanel(); accept = getApproveButton(filechooser); cancel = new JButton(cancelButtonText); cancel.setMnemonic(cancelButtonMnemonic); cancel.setToolTipText(cancelButtonToolTipText); closePanel.add(accept); closePanel.add(cancel); c.anchor = GridBagConstraints.WEST; c.weighty = 0; c.weightx = 0; c.gridx = 0; bottomPanel = new JPanel(); bottomPanel.setLayout(new GridBagLayout()); bottomPanel.add(fileNameLabel, c); c.gridy = 1; bottomPanel.add(fileTypesLabel, c); c.gridx = 1; c.gridy = 0; c.weightx = 1; c.weighty = 1; bottomPanel.add(entry, c); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.NONE; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); filechooser.setLayout(new BorderLayout()); filechooser.add(topPanel, BorderLayout.NORTH); filechooser.add(centrePanel, BorderLayout.CENTER); filechooser.add(bottomPanel, BorderLayout.SOUTH); }
3,091
public Object action (SaxDocumentHandler handler, AttributeList attrs) { // create new object appropriately Axis newaxis = new Axis(); newaxis.setXMLAttributes(attrs); // set XML attributes from passed list // Every axis must have *either* axisId *or* an axisIdRef // else, its illegal! String axisId = null; String axisIdRef = null; if ( (axisId = newaxis.getAxisId()) != null || (axisIdRef = newaxis.getAxisIdRef()) != null ) { // add this object to the lookup table, if it has an ID if (axisId != null) { // a warning check, just in case if (AxisObj.containsKey(axisId)) Log.warnln("More than one axis node with axisId=\""+axisId+"\", using latest node." ); // add this into the list of axis objects AxisObj.put(axisId, newaxis); } // If there is a reference object, clone it to get // the new axis if (axisIdRef != null) { if (AxisObj.containsKey(axisIdRef)) { BaseObject refAxisObj = (BaseObject) AxisObj.get(axisIdRef); try { newaxis = (Axis) refAxisObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone axis object. Aborting read."); System.exit(-1); } // override attrs with those in passed list newaxis.setXMLAttributes(attrs); newaxis.setAxisId(null); // shouldnt have the axisId from refObj } else { Log.warnln("Error: Reader got an axis with AxisIdRef=\""+axisIdRef+"\" but no previous axis has that id! Ignoring add axis request."); return (Object) null; } } // add this axis to the current array object CurrentArray.addAxis(newaxis); // I dont believe this is actually used // CurrentDatatypeObject = newaxis; } else { Log.errorln("Axis object:"+newaxis+" lacks either axisId or axisIdRef, ignoring!"); } return newaxis; }
public Object action (SaxDocumentHandler handler, AttributeList attrs) { // create new object appropriately Axis newaxis = new Axis(); newaxis.setXMLAttributes(attrs); // set XML attributes from passed list // Every axis must have *either* axisId *or* an axisIdRef // else, its illegal! String axisId = null; String axisIdRef = null; if ( (axisId = newaxis.getAxisId()) != null || (axisIdRef = newaxis.getAxisIdRef()) != null ) { // add this object to the lookup table, if it has an ID if (axisId != null) { // a warning check, just in case if (AxisObj.containsKey(axisId)) Log.warnln("More than one axis node with axisId=\""+axisId+"\", using latest node." ); // add this into the list of axis objects AxisObj.put(axisId, newaxis); } // If there is a reference object, clone it to get // the new axis if (axisIdRef != null) { if (AxisObj.containsKey(axisIdRef)) { BaseObject refAxisObj = (BaseObject) AxisObj.get(axisIdRef); try { newaxis = (Axis) refAxisObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone axis object. Aborting read."); System.exit(-1); } // override attrs with those in passed list newaxis.setXMLAttributes(attrs); newaxis.setAxisId(findUniqueIdName(AxisObj,newaxis.getAxisId())); AxisObj.put(newaxis.getAxisId(), newaxis); // shouldnt have the axisId from refObj } else { Log.warnln("Error: Reader got an axis with AxisIdRef=\""+axisIdRef+"\" but no previous axis has that id! Ignoring add axis request."); return (Object) null; } } // add this axis to the current array object CurrentArray.addAxis(newaxis); // I dont believe this is actually used // CurrentDatatypeObject = newaxis; } else { Log.errorln("Axis object:"+newaxis+" lacks either axisId or axisIdRef, ignoring!"); } return newaxis; }
3,093
public void action (SaxDocumentHandler handler) { // we stopped reading datanode, lower count by one DataNodeLevel--; // we might still be nested within a data node // if so, return now to accumulate more data within the DATABLOCK if(DataNodeLevel != 0) return; // now we are ready to read in untagged data (both delimited/formmatted styles) // from the DATABLOCK // Note: unfortunately we are reduced to using regex style matching // instead of a buffer read in formatted reads. Come back and // improve this later if possible. XMLDataIOStyle formatObj = CurrentArray.getXMLDataIOStyle(); if ( formatObj instanceof DelimitedXMLDataIOStyle || formatObj instanceof FormattedXMLDataIOStyle ) { // determine the size of the dataFormat (s) in our dataCube if (CurrentArray.hasFieldAxis()) { // if there is a field axis, then its set to the number of fields FieldAxis fieldAxis = CurrentArray.getFieldAxis(); MaxDataFormatIndex = (fieldAxis.getLength()-1); } else { // its homogeneous MaxDataFormatIndex = 0; } Locator myLocator = CurrentArray.createLocator();List iterationList = myLocator.getIterationOrder();Iterator liter = iterationList.iterator();while (liter.hasNext()) { Axis axis = (Axis) liter.next(); Log.errorln("ITERATION AXIS NAME:"+axis.getName());} myLocator.setIterationOrder(AxisReadOrder); CurrentDataFormatIndex = 0; ArrayList strValueList;// boolean dataHasSpecialIntegers = false; // set up appropriate instructions for reading if ( formatObj instanceof FormattedXMLDataIOStyle ) {/* $template = $formatObj->_templateNotation(1); $recordSize = $formatObj->bytes(); $data_has_special_integers = $formatObj->hasSpecialIntegers;*/ // snag the string representation of the values strValueList = formattedSplitStringIntoStringObjects( DATABLOCK.toString(), ((FormattedXMLDataIOStyle) formatObj) ); if (strValueList.size() == 0) { Log.errorln("Error: XDF Reader is unable to acquire formatted data, bad format?"); System.exit(-1); } } else { // snag the string representation of the values strValueList = splitStringIntoStringObjects( DATABLOCK.toString(), ((DelimitedXMLDataIOStyle) formatObj).getDelimiter(), ((DelimitedXMLDataIOStyle) formatObj).getRepeatable(), ((DelimitedXMLDataIOStyle) formatObj).getRecordTerminator() ); } // fire data into dataCube Iterator iter = strValueList.iterator(); while (iter.hasNext()) { DataFormat CurrentDataFormat = DataFormatList[CurrentDataFormatIndex]; // adding data based on what type.. addDataToCurrentArray(myLocator, (String) iter.next(), CurrentDataFormat); // bump up DataFormat appropriately if (MaxDataFormatIndex > 0) { int currentFastAxisCoordinate = myLocator.getAxisLocation(FastestAxis); if ( currentFastAxisCoordinate != LastFastAxisCoordinate ) { LastFastAxisCoordinate = currentFastAxisCoordinate; if (CurrentDataFormatIndex == MaxDataFormatIndex) CurrentDataFormatIndex = 0; else CurrentDataFormatIndex++; } } myLocator.next(); } } else if ( formatObj instanceof TaggedXMLDataIOStyle ) { // Tagged case: do nothing } else { Log.errorln("ERROR: Completely unknown DATA IO style:"+formatObj.toString() +" aborting read!"); System.exit(-1); } }
public void action (SaxDocumentHandler handler) { // we stopped reading datanode, lower count by one DataNodeLevel--; // we might still be nested within a data node // if so, return now to accumulate more data within the DATABLOCK if(DataNodeLevel != 0) return; // now we are ready to read in untagged data (both delimited/formmatted styles) // from the DATABLOCK // Note: unfortunately we are reduced to using regex style matching // instead of a buffer read in formatted reads. Come back and // improve this later if possible. XMLDataIOStyle formatObj = CurrentArray.getXMLDataIOStyle(); if ( formatObj instanceof DelimitedXMLDataIOStyle || formatObj instanceof FormattedXMLDataIOStyle ) { // determine the size of the dataFormat (s) in our dataCube if (CurrentArray.hasFieldAxis()) { // if there is a field axis, then its set to the number of fields FieldAxis fieldAxis = CurrentArray.getFieldAxis(); MaxDataFormatIndex = (fieldAxis.getLength()-1); } else { // its homogeneous MaxDataFormatIndex = 0; } Locator myLocator = CurrentArray.createLocator();List iterationList = myLocator.getIterationOrder();Iterator liter = iterationList.iterator();while (liter.hasNext()) { Axis axis = (Axis) liter.next(); Log.errorln("ITERATION AXIS NAME:"+axis.getName());} myLocator.setIterationOrder(AxisReadOrder); CurrentDataFormatIndex = 0; ArrayList strValueList;// boolean dataHasSpecialIntegers = false; // set up appropriate instructions for reading if ( formatObj instanceof FormattedXMLDataIOStyle ) {/* $template = $formatObj->_templateNotation(1); $recordSize = $formatObj->bytes(); $data_has_special_integers = $formatObj->hasSpecialIntegers;*/ // snag the string representation of the values strValueList = formattedSplitStringIntoStringObjects( DATABLOCK.toString(), ((FormattedXMLDataIOStyle) formatObj) ); if (strValueList.size() == 0) { Log.errorln("Error: XDF Reader is unable to acquire formatted data, bad format?"); System.exit(-1); } } else { // snag the string representation of the values strValueList = splitStringIntoStringObjects( DATABLOCK.toString(), ((DelimitedXMLDataIOStyle) formatObj).getDelimiter(), ((DelimitedXMLDataIOStyle) formatObj).getRepeatable(), ((DelimitedXMLDataIOStyle) formatObj).getRecordTerminator() ); } // fire data into dataCube Iterator iter = strValueList.iterator(); while (iter.hasNext()) { DataFormat CurrentDataFormat = DataFormatList[CurrentDataFormatIndex]; // adding data based on what type.. addDataToCurrentArray(myLocator, (String) iter.next(), CurrentDataFormat); // bump up DataFormat appropriately if (MaxDataFormatIndex > 0) { int currentFastAxisCoordinate = myLocator.getAxisLocation(FastestAxis); if ( currentFastAxisCoordinate != LastFastAxisCoordinate ) { LastFastAxisCoordinate = currentFastAxisCoordinate; if (CurrentDataFormatIndex == MaxDataFormatIndex) CurrentDataFormatIndex = 0; else CurrentDataFormatIndex++; } } myLocator.next(); } } else if ( formatObj instanceof TaggedXMLDataIOStyle ) { // Tagged case: do nothing } else { Log.errorln("ERROR: Completely unknown DATA IO style:"+formatObj.toString() +" aborting read!"); System.exit(-1); } }
3,094
public void action (SaxDocumentHandler handler) { // we stopped reading datanode, lower count by one DataNodeLevel--; // we might still be nested within a data node // if so, return now to accumulate more data within the DATABLOCK if(DataNodeLevel != 0) return; // now we are ready to read in untagged data (both delimited/formmatted styles) // from the DATABLOCK // Note: unfortunately we are reduced to using regex style matching // instead of a buffer read in formatted reads. Come back and // improve this later if possible. XMLDataIOStyle formatObj = CurrentArray.getXMLDataIOStyle(); if ( formatObj instanceof DelimitedXMLDataIOStyle || formatObj instanceof FormattedXMLDataIOStyle ) { // determine the size of the dataFormat (s) in our dataCube if (CurrentArray.hasFieldAxis()) { // if there is a field axis, then its set to the number of fields FieldAxis fieldAxis = CurrentArray.getFieldAxis(); MaxDataFormatIndex = (fieldAxis.getLength()-1); } else { // its homogeneous MaxDataFormatIndex = 0; } Locator myLocator = CurrentArray.createLocator();List iterationList = myLocator.getIterationOrder();Iterator liter = iterationList.iterator();while (liter.hasNext()) { Axis axis = (Axis) liter.next(); Log.errorln("ITERATION AXIS NAME:"+axis.getName());} myLocator.setIterationOrder(AxisReadOrder); CurrentDataFormatIndex = 0; ArrayList strValueList;// boolean dataHasSpecialIntegers = false; // set up appropriate instructions for reading if ( formatObj instanceof FormattedXMLDataIOStyle ) {/* $template = $formatObj->_templateNotation(1); $recordSize = $formatObj->bytes(); $data_has_special_integers = $formatObj->hasSpecialIntegers;*/ // snag the string representation of the values strValueList = formattedSplitStringIntoStringObjects( DATABLOCK.toString(), ((FormattedXMLDataIOStyle) formatObj) ); if (strValueList.size() == 0) { Log.errorln("Error: XDF Reader is unable to acquire formatted data, bad format?"); System.exit(-1); } } else { // snag the string representation of the values strValueList = splitStringIntoStringObjects( DATABLOCK.toString(), ((DelimitedXMLDataIOStyle) formatObj).getDelimiter(), ((DelimitedXMLDataIOStyle) formatObj).getRepeatable(), ((DelimitedXMLDataIOStyle) formatObj).getRecordTerminator() ); } // fire data into dataCube Iterator iter = strValueList.iterator(); while (iter.hasNext()) { DataFormat CurrentDataFormat = DataFormatList[CurrentDataFormatIndex]; // adding data based on what type.. addDataToCurrentArray(myLocator, (String) iter.next(), CurrentDataFormat); // bump up DataFormat appropriately if (MaxDataFormatIndex > 0) { int currentFastAxisCoordinate = myLocator.getAxisLocation(FastestAxis); if ( currentFastAxisCoordinate != LastFastAxisCoordinate ) { LastFastAxisCoordinate = currentFastAxisCoordinate; if (CurrentDataFormatIndex == MaxDataFormatIndex) CurrentDataFormatIndex = 0; else CurrentDataFormatIndex++; } } myLocator.next(); } } else if ( formatObj instanceof TaggedXMLDataIOStyle ) { // Tagged case: do nothing } else { Log.errorln("ERROR: Completely unknown DATA IO style:"+formatObj.toString() +" aborting read!"); System.exit(-1); } }
publicvoidaction(SaxDocumentHandlerhandler){//westoppedreadingdatanode,lowercountbyoneDataNodeLevel--;//wemightstillbenestedwithinadatanode//ifso,returnnowtoaccumulatemoredatawithintheDATABLOCKif(DataNodeLevel!=0)return;//nowwearereadytoreadinuntaggeddata(bothdelimited/formmattedstyles)//fromtheDATABLOCK//Note:unfortunatelywearereducedtousingregexstylematching//insteadofabufferreadinformattedreads.Comebackand//improvethislaterifpossible.XMLDataIOStyleformatObj=CurrentArray.getXMLDataIOStyle();if(formatObjinstanceofDelimitedXMLDataIOStyle||formatObjinstanceofFormattedXMLDataIOStyle){//determinethesizeofthedataFormat(s)inourdataCubeif(CurrentArray.hasFieldAxis()){//ifthereisafieldaxis,thenitssettothenumberoffieldsFieldAxisfieldAxis=CurrentArray.getFieldAxis();MaxDataFormatIndex=(fieldAxis.getLength()-1);}else{//itshomogeneousMaxDataFormatIndex=0;}LocatormyLocator=CurrentArray.createLocator();ListiterationList=myLocator.getIterationOrder();Iteratorliter=iterationList.iterator();while(liter.hasNext()){Axisaxis=(Axis)liter.next();Log.errorln("ITERATIONAXISNAME:"+axis.getName());}myLocator.setIterationOrder(AxisReadOrder);CurrentDataFormatIndex=0;ArrayListstrValueList;//booleandataHasSpecialIntegers=false;//setupappropriateinstructionsforreadingif(formatObjinstanceofFormattedXMLDataIOStyle){/*$template=$formatObj->_templateNotation(1);$recordSize=$formatObj->bytes();$data_has_special_integers=$formatObj->hasSpecialIntegers;*///snagthestringrepresentationofthevaluesstrValueList=formattedSplitStringIntoStringObjects(DATABLOCK.toString(),((FormattedXMLDataIOStyle)formatObj));if(strValueList.size()==0){Log.errorln("Error:XDFReaderisunabletoacquireformatteddata,badformat?");System.exit(-1);}}else{//snagthestringrepresentationofthevaluesstrValueList=splitStringIntoStringObjects(DATABLOCK.toString(),((DelimitedXMLDataIOStyle)formatObj).getDelimiter(),((DelimitedXMLDataIOStyle)formatObj).getRepeatable(),((DelimitedXMLDataIOStyle)formatObj).getRecordTerminator());}//firedataintodataCubeIteratoriter=strValueList.iterator();while(iter.hasNext()){DataFormatCurrentDataFormat=DataFormatList[CurrentDataFormatIndex];//addingdatabasedonwhattype..addDataToCurrentArray(myLocator,(String)iter.next(),CurrentDataFormat);//bumpupDataFormatappropriatelyif(MaxDataFormatIndex>0){intcurrentFastAxisCoordinate=myLocator.getAxisLocation(FastestAxis);if(currentFastAxisCoordinate!=LastFastAxisCoordinate){LastFastAxisCoordinate=currentFastAxisCoordinate;if(CurrentDataFormatIndex==MaxDataFormatIndex)CurrentDataFormatIndex=0;elseCurrentDataFormatIndex++;}}myLocator.next();}}elseif(formatObjinstanceofTaggedXMLDataIOStyle){//Taggedcase:donothing}else{Log.errorln("ERROR:CompletelyunknownDATAIOstyle:"+formatObj.toString()+"abortingread!");System.exit(-1);}}
3,095
public void action (SaxDocumentHandler handler) { // we stopped reading datanode, lower count by one DataNodeLevel--; // we might still be nested within a data node // if so, return now to accumulate more data within the DATABLOCK if(DataNodeLevel != 0) return; // now we are ready to read in untagged data (both delimited/formmatted styles) // from the DATABLOCK // Note: unfortunately we are reduced to using regex style matching // instead of a buffer read in formatted reads. Come back and // improve this later if possible. XMLDataIOStyle formatObj = CurrentArray.getXMLDataIOStyle(); if ( formatObj instanceof DelimitedXMLDataIOStyle || formatObj instanceof FormattedXMLDataIOStyle ) { // determine the size of the dataFormat (s) in our dataCube if (CurrentArray.hasFieldAxis()) { // if there is a field axis, then its set to the number of fields FieldAxis fieldAxis = CurrentArray.getFieldAxis(); MaxDataFormatIndex = (fieldAxis.getLength()-1); } else { // its homogeneous MaxDataFormatIndex = 0; } Locator myLocator = CurrentArray.createLocator();List iterationList = myLocator.getIterationOrder();Iterator liter = iterationList.iterator();while (liter.hasNext()) { Axis axis = (Axis) liter.next(); Log.errorln("ITERATION AXIS NAME:"+axis.getName());} myLocator.setIterationOrder(AxisReadOrder); CurrentDataFormatIndex = 0; ArrayList strValueList;// boolean dataHasSpecialIntegers = false; // set up appropriate instructions for reading if ( formatObj instanceof FormattedXMLDataIOStyle ) {/* $template = $formatObj->_templateNotation(1); $recordSize = $formatObj->bytes(); $data_has_special_integers = $formatObj->hasSpecialIntegers;*/ // snag the string representation of the values strValueList = formattedSplitStringIntoStringObjects( DATABLOCK.toString(), ((FormattedXMLDataIOStyle) formatObj) ); if (strValueList.size() == 0) { Log.errorln("Error: XDF Reader is unable to acquire formatted data, bad format?"); System.exit(-1); } } else { // snag the string representation of the values strValueList = splitStringIntoStringObjects( DATABLOCK.toString(), ((DelimitedXMLDataIOStyle) formatObj).getDelimiter(), ((DelimitedXMLDataIOStyle) formatObj).getRepeatable(), ((DelimitedXMLDataIOStyle) formatObj).getRecordTerminator() ); } // fire data into dataCube Iterator iter = strValueList.iterator(); while (iter.hasNext()) { DataFormat CurrentDataFormat = DataFormatList[CurrentDataFormatIndex]; // adding data based on what type.. addDataToCurrentArray(myLocator, (String) iter.next(), CurrentDataFormat); // bump up DataFormat appropriately if (MaxDataFormatIndex > 0) { int currentFastAxisCoordinate = myLocator.getAxisLocation(FastestAxis); if ( currentFastAxisCoordinate != LastFastAxisCoordinate ) { LastFastAxisCoordinate = currentFastAxisCoordinate; if (CurrentDataFormatIndex == MaxDataFormatIndex) CurrentDataFormatIndex = 0; else CurrentDataFormatIndex++; } } myLocator.next(); } } else if ( formatObj instanceof TaggedXMLDataIOStyle ) { // Tagged case: do nothing } else { Log.errorln("ERROR: Completely unknown DATA IO style:"+formatObj.toString() +" aborting read!"); System.exit(-1); } }
publicvoidaction(SaxDocumentHandlerhandler){//westoppedreadingdatanode,lowercountbyoneDataNodeLevel--;//wemightstillbenestedwithinadatanode//ifso,returnnowtoaccumulatemoredatawithintheDATABLOCKif(DataNodeLevel!=0)return;//nowwearereadytoreadinuntaggeddata(bothdelimited/formmattedstyles)//fromtheDATABLOCK//Note:unfortunatelywearereducedtousingregexstylematching//insteadofabufferreadinformattedreads.Comebackand//improvethislaterifpossible.XMLDataIOStyleformatObj=CurrentArray.getXMLDataIOStyle();if(formatObjinstanceofDelimitedXMLDataIOStyle||formatObjinstanceofFormattedXMLDataIOStyle){//determinethesizeofthedataFormat(s)inourdataCubeif(CurrentArray.hasFieldAxis()){//ifthereisafieldaxis,thenitssettothenumberoffieldsFieldAxisfieldAxis=CurrentArray.getFieldAxis();MaxDataFormatIndex=(fieldAxis.getLength()-1);}else{//itshomogeneousMaxDataFormatIndex=0;}LocatormyLocator=CurrentArray.createLocator();ListiterationList=myLocator.getIterationOrder();Iteratorliter=iterationList.iterator();while(liter.hasNext()){Axisaxis=(Axis)liter.next();Log.errorln("ITERATIONAXISNAME:"+axis.getName());}myLocator.setIterationOrder(AxisReadOrder);CurrentDataFormatIndex=0;ArrayListstrValueList;//booleandataHasSpecialIntegers=false;//setupappropriateinstructionsforreadingif(formatObjinstanceofFormattedXMLDataIOStyle){/*$template=$formatObj->_templateNotation(1);$recordSize=$formatObj->bytes();$data_has_special_integers=$formatObj->hasSpecialIntegers;*///snagthestringrepresentationofthevaluesstrValueList=formattedSplitStringIntoStringObjects(DATABLOCK.toString(),((FormattedXMLDataIOStyle)formatObj));if(strValueList.size()==0){Log.errorln("Error:XDFReaderisunabletoacquireformatteddata,badformat?");System.exit(-1);}}else{//snagthestringrepresentationofthevaluesstrValueList=splitStringIntoStringObjects(DATABLOCK.toString(),((DelimitedXMLDataIOStyle)formatObj).getDelimiter(),((DelimitedXMLDataIOStyle)formatObj).getRepeatable(),((DelimitedXMLDataIOStyle)formatObj).getRecordTerminator());}//firedataintodataCubeIteratoriter=strValueList.iterator();while(iter.hasNext()){DataFormatCurrentDataFormat=DataFormatList[CurrentDataFormatIndex];//addingdatabasedonwhattype..addDataToCurrentArray(myLocator,(String)iter.next(),CurrentDataFormat);//bumpupDataFormatappropriatelyif(MaxDataFormatIndex>0){intcurrentFastAxisCoordinate=myLocator.getAxisLocation(FastestAxis);if(currentFastAxisCoordinate!=LastFastAxisCoordinate){LastFastAxisCoordinate=currentFastAxisCoordinate;if(CurrentDataFormatIndex==MaxDataFormatIndex)CurrentDataFormatIndex=0;elseCurrentDataFormatIndex++;}}myLocator.next();}}elseif(formatObjinstanceofTaggedXMLDataIOStyle){//Taggedcase:donothing}else{Log.errorln("ERROR:CompletelyunknownDATAIOstyle:"+formatObj.toString()+"abortingread!");System.exit(-1);}}
3,096
public void action (SaxDocumentHandler handler) { // we stopped reading datanode, lower count by one DataNodeLevel--; // we might still be nested within a data node // if so, return now to accumulate more data within the DATABLOCK if(DataNodeLevel != 0) return; // now we are ready to read in untagged data (both delimited/formmatted styles) // from the DATABLOCK // Note: unfortunately we are reduced to using regex style matching // instead of a buffer read in formatted reads. Come back and // improve this later if possible. XMLDataIOStyle formatObj = CurrentArray.getXMLDataIOStyle(); if ( formatObj instanceof DelimitedXMLDataIOStyle || formatObj instanceof FormattedXMLDataIOStyle ) { // determine the size of the dataFormat (s) in our dataCube if (CurrentArray.hasFieldAxis()) { // if there is a field axis, then its set to the number of fields FieldAxis fieldAxis = CurrentArray.getFieldAxis(); MaxDataFormatIndex = (fieldAxis.getLength()-1); } else { // its homogeneous MaxDataFormatIndex = 0; } Locator myLocator = CurrentArray.createLocator();List iterationList = myLocator.getIterationOrder();Iterator liter = iterationList.iterator();while (liter.hasNext()) { Axis axis = (Axis) liter.next(); Log.errorln("ITERATION AXIS NAME:"+axis.getName());} myLocator.setIterationOrder(AxisReadOrder); CurrentDataFormatIndex = 0; ArrayList strValueList;// boolean dataHasSpecialIntegers = false; // set up appropriate instructions for reading if ( formatObj instanceof FormattedXMLDataIOStyle ) {/* $template = $formatObj->_templateNotation(1); $recordSize = $formatObj->bytes(); $data_has_special_integers = $formatObj->hasSpecialIntegers;*/ // snag the string representation of the values strValueList = formattedSplitStringIntoStringObjects( DATABLOCK.toString(), ((FormattedXMLDataIOStyle) formatObj) ); if (strValueList.size() == 0) { Log.errorln("Error: XDF Reader is unable to acquire formatted data, bad format?"); System.exit(-1); } } else { // snag the string representation of the values strValueList = splitStringIntoStringObjects( DATABLOCK.toString(), ((DelimitedXMLDataIOStyle) formatObj).getDelimiter(), ((DelimitedXMLDataIOStyle) formatObj).getRepeatable(), ((DelimitedXMLDataIOStyle) formatObj).getRecordTerminator() ); } // fire data into dataCube Iterator iter = strValueList.iterator(); while (iter.hasNext()) { DataFormat CurrentDataFormat = DataFormatList[CurrentDataFormatIndex]; // adding data based on what type.. addDataToCurrentArray(myLocator, (String) iter.next(), CurrentDataFormat); // bump up DataFormat appropriately if (MaxDataFormatIndex > 0) { int currentFastAxisCoordinate = myLocator.getAxisLocation(FastestAxis); if ( currentFastAxisCoordinate != LastFastAxisCoordinate ) { LastFastAxisCoordinate = currentFastAxisCoordinate; if (CurrentDataFormatIndex == MaxDataFormatIndex) CurrentDataFormatIndex = 0; else CurrentDataFormatIndex++; } } myLocator.next(); } } else if ( formatObj instanceof TaggedXMLDataIOStyle ) { // Tagged case: do nothing } else { Log.errorln("ERROR: Completely unknown DATA IO style:"+formatObj.toString() +" aborting read!"); System.exit(-1); } }
public void action (SaxDocumentHandler handler) { // we stopped reading datanode, lower count by one DataNodeLevel--; // we might still be nested within a data node // if so, return now to accumulate more data within the DATABLOCK if(DataNodeLevel != 0) return; // now we are ready to read in untagged data (both delimited/formmatted styles) // from the DATABLOCK // Note: unfortunately we are reduced to using regex style matching // instead of a buffer read in formatted reads. Come back and // improve this later if possible. XMLDataIOStyle formatObj = CurrentArray.getXMLDataIOStyle(); if ( formatObj instanceof DelimitedXMLDataIOStyle || formatObj instanceof FormattedXMLDataIOStyle ) { // determine the size of the dataFormat (s) in our dataCube if (CurrentArray.hasFieldAxis()) { // if there is a field axis, then its set to the number of fields FieldAxis fieldAxis = CurrentArray.getFieldAxis(); MaxDataFormatIndex = (fieldAxis.getLength()-1); } else { // its homogeneous MaxDataFormatIndex = 0; } Locator myLocator = CurrentArray.createLocator();List iterationList = myLocator.getIterationOrder();Iterator liter = iterationList.iterator();while (liter.hasNext()) { Axis axis = (Axis) liter.next(); Log.errorln("ITERATION AXIS NAME:"+axis.getName());} myLocator.setIterationOrder(AxisReadOrder); CurrentDataFormatIndex = 0; ArrayList strValueList;// boolean dataHasSpecialIntegers = false; // set up appropriate instructions for reading if ( formatObj instanceof FormattedXMLDataIOStyle ) {/* $template = $formatObj->_templateNotation(1); $recordSize = $formatObj->bytes(); $data_has_special_integers = $formatObj->hasSpecialIntegers;*/ // snag the string representation of the values strValueList = formattedSplitStringIntoStringObjects( DATABLOCK.toString(), ((FormattedXMLDataIOStyle) formatObj) ); if (strValueList.size() == 0) { Log.errorln("Error: XDF Reader is unable to acquire formatted data, bad format?"); System.exit(-1); } } else { // snag the string representation of the values strValueList = splitStringIntoStringObjects( DATABLOCK.toString(), ((DelimitedXMLDataIOStyle) formatObj).getDelimiter(), ((DelimitedXMLDataIOStyle) formatObj).getRepeatable(), ((DelimitedXMLDataIOStyle) formatObj).getRecordTerminator() ); } // fire data into dataCube Iterator iter = strValueList.iterator(); while (iter.hasNext()) { DataFormat CurrentDataFormat = DataFormatList[CurrentDataFormatIndex]; // adding data based on what type.. String thisData = (String) iter.next(); addDataToCurrentArray(myLocator, thisData, CurrentDataFormat); // bump up DataFormat appropriately if (MaxDataFormatIndex > 0) { int currentFastAxisCoordinate = myLocator.getAxisLocation(FastestAxis); if ( currentFastAxisCoordinate != LastFastAxisCoordinate ) { LastFastAxisCoordinate = currentFastAxisCoordinate; if (CurrentDataFormatIndex == MaxDataFormatIndex) CurrentDataFormatIndex = 0; else CurrentDataFormatIndex++; } } myLocator.next(); } } else if ( formatObj instanceof TaggedXMLDataIOStyle ) { // Tagged case: do nothing } else { Log.errorln("ERROR: Completely unknown DATA IO style:"+formatObj.toString() +" aborting read!"); System.exit(-1); } }
3,097
public Object action (SaxDocumentHandler handler, AttributeList attrs) { // we only need to do these things for the first time we enter // a data node if (DataNodeLevel == 0) { // update the array dataCube with passed attributes CurrentArray.getDataCube().setXMLAttributes(attrs); // determine the size of the dataFormat (s) in our dataCube if (CurrentArray.hasFieldAxis()) { // if there is a field axis, then its set to the number of fields FieldAxis fieldAxis = CurrentArray.getFieldAxis(); MaxDataFormatIndex = (fieldAxis.getLength()-1); } else { // its homogeneous MaxDataFormatIndex = 0; } // reset to start of which dataformat type we currently are reading CurrentDataFormatIndex = 0; // reset the list of dataformats we are reading DataFormatList = CurrentArray.getDataFormatList(); } XMLDataIOStyle readObj = CurrentArray.getXMLDataIOStyle(); FastestAxis = (AxisInterface) CurrentArray.getAxisList().get(0); LastFastAxisCoordinate = 0; if ( readObj instanceof TaggedXMLDataIOStyle) { TaggedLocatorObj = CurrentArray.createLocator(); } else { // A safety. We clear datablock when this is the first datanode we // have entered DATABLOCK is used in cases where we read in untagged data if (DataNodeLevel == 0) DATABLOCK = new StringBuffer (); } // entered a datanode, raise the count // this (partially helps) declare we are now reading data, DataNodeLevel++; return readObj; }
public Object action (SaxDocumentHandler handler, AttributeList attrs) { // we only need to do these things for the first time we enter // a data node if (DataNodeLevel == 0) { // update the array dataCube with passed attributes CurrentArray.getDataCube().setXMLAttributes(attrs); // determine the size of the dataFormat (s) in our dataCube if (CurrentArray.hasFieldAxis()) { // if there is a field axis, then its set to the number of fields FieldAxis fieldAxis = CurrentArray.getFieldAxis(); MaxDataFormatIndex = (fieldAxis.getLength()-1); } else { // its homogeneous MaxDataFormatIndex = 0; } // reset to start of which dataformat type we currently are reading CurrentDataFormatIndex = 0; // reset the list of dataformats we are reading DataFormatList = CurrentArray.getDataFormatList(); } XMLDataIOStyle readObj = CurrentArray.getXMLDataIOStyle(); FastestAxis = (AxisInterface) CurrentArray.getAxisList().get(0); LastFastAxisCoordinate = -1; if ( readObj instanceof TaggedXMLDataIOStyle) { TaggedLocatorObj = CurrentArray.createLocator(); } else { // A safety. We clear datablock when this is the first datanode we // have entered DATABLOCK is used in cases where we read in untagged data if (DataNodeLevel == 0) DATABLOCK = new StringBuffer (); } // entered a datanode, raise the count // this (partially helps) declare we are now reading data, DataNodeLevel++; return readObj; }
3,098
public Object action (SaxDocumentHandler handler, AttributeList attrs) { // create new object appropriately Field newfield = new Field(); newfield.setXMLAttributes(attrs); // set XML attributes from passed list // grab the field axis and add the field FieldAxis fieldAxis = CurrentArray.getFieldAxis(); fieldAxis.addField(newfield); String fieldId = newfield.getFieldId(); String fieldIdRef = newfield.getFieldIdRef(); // add this object to the lookup table, if it has an ID if (fieldId != null) { // a warning check, just in case if (FieldObj.containsKey(fieldId)) Log.warnln("More than one field node with fieldId=\""+fieldId+"\", using latest node." ); // add this into the list of field objects FieldObj.put(fieldId, newfield); } // If there is a reference object, clone it to get // the new field if (fieldIdRef != null) { if (FieldObj.containsKey(fieldIdRef)) { BaseObject refFieldObj = (BaseObject) FieldObj.get(fieldIdRef); try { newfield = (Field) refFieldObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone field object. Aborting read."); System.exit(-1); } // override attrs with those in passed list newfield.setXMLAttributes(attrs); newfield.setFieldId(null); // shouldnt have fieldId from the refObj } else { Log.warnln("Error: Reader got an field with FieldIdRef=\""+fieldIdRef+"\" but no previous field has that id! Ignoring add field request."); return (Object) null; } } // add this object to all open field groups Iterator iter = CurrentFieldGroupList.iterator(); while (iter.hasNext()) { FieldGroup nextFieldGroupObj = (FieldGroup) iter.next(); newfield.addToGroup(nextFieldGroupObj); } CurrentDatatypeObject = newfield; LastFieldObject = newfield; return newfield; }
public Object action (SaxDocumentHandler handler, AttributeList attrs) { // create new object appropriately Field newfield = new Field(); newfield.setXMLAttributes(attrs); // set XML attributes from passed list // grab the field axis and add the field FieldAxis fieldAxis = CurrentArray.getFieldAxis(); fieldAxis.addField(newfield); String fieldId = newfield.getFieldId(); String fieldIdRef = newfield.getFieldIdRef(); // add this object to the lookup table, if it has an ID if (fieldId != null) { // a warning check, just in case if (FieldObj.containsKey(fieldId)) Log.warnln("More than one field node with fieldId=\""+fieldId+"\", using latest node." ); // add this into the list of field objects FieldObj.put(fieldId, newfield); } // If there is a reference object, clone it to get // the new field if (fieldIdRef != null) { if (FieldObj.containsKey(fieldIdRef)) { BaseObject refFieldObj = (BaseObject) FieldObj.get(fieldIdRef); try { newfield = (Field) refFieldObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone field object. Aborting read."); System.exit(-1); } // override attrs with those in passed list newfield.setXMLAttributes(attrs); newfield.setFieldId(findUniqueIdName(FieldObj, newfield.getFieldId())); FieldObj.put(newfield.getFieldId(), newfield); // shouldnt have fieldId from the refObj } else { Log.warnln("Error: Reader got an field with FieldIdRef=\""+fieldIdRef+"\" but no previous field has that id! Ignoring add field request."); return (Object) null; } } // add this object to all open field groups Iterator iter = CurrentFieldGroupList.iterator(); while (iter.hasNext()) { FieldGroup nextFieldGroupObj = (FieldGroup) iter.next(); newfield.addToGroup(nextFieldGroupObj); } CurrentDatatypeObject = newfield; LastFieldObject = newfield; return newfield; }
3,100
public Object action (SaxDocumentHandler handler, AttributeList attrs) { String parentNodeName = getParentNodeName(); // create new object appropriately Note newnote = new Note(); newnote.setXMLAttributes(attrs); // set XML attributes from passed list String noteId = newnote.getNoteId(); String noteIdRef = newnote.getNoteIdRef(); // add this object to the lookup table, if it has an ID if (noteId != null) { // a warning check, just in case if (NoteObj.containsKey(noteId)) Log.warnln("More than one note node with noteId=\""+noteId+"\", using latest node." ); // add this into the list of note objects NoteObj.put(noteId, newnote); } // If there is a reference object, clone it to get // the new axis if (noteIdRef != null) { if (NoteObj.containsKey(noteIdRef)) { BaseObject refNoteObj = (BaseObject) NoteObj.get(noteIdRef); try { newnote = (Note) refNoteObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone note object. Aborting read."); System.exit(-1); } // override attrs with those in passed list newnote.setXMLAttributes(attrs); newnote.setNoteId(null); // note shouldnt have noteId from the parent } else { Log.warnln("Error: Reader got a note with NoteIdRef=\""+noteIdRef+"\" but no previous note has that id! Ignoring add note request."); return (Object) null; } } // add this object to parent object if( parentNodeName.equals(XDFNodeName.NOTES) ) { // only NOTES objects appear in arrays, so we can // just add to the current array CurrentArray.addNote(newnote); } else if ( parentNodeName.equals(XDFNodeName.FIELD) ) { LastFieldObject.addNote(newnote); } else if ( parentNodeName.equals(XDFNodeName.PARAMETER) ) { LastParameterObject.addNote(newnote); } else { Log.warnln( "Unknown parent node: "+parentNodeName+" for note. Ignoring."); } LastNoteObject = newnote; return newnote; }
public Object action (SaxDocumentHandler handler, AttributeList attrs) { String parentNodeName = getParentNodeName(); // create new object appropriately Note newnote = new Note(); newnote.setXMLAttributes(attrs); // set XML attributes from passed list String noteId = newnote.getNoteId(); String noteIdRef = newnote.getNoteIdRef(); // add this object to the lookup table, if it has an ID if (noteId != null) { // a warning check, just in case if (NoteObj.containsKey(noteId)) Log.warnln("More than one note node with noteId=\""+noteId+"\", using latest node." ); // add this into the list of note objects NoteObj.put(noteId, newnote); } // If there is a reference object, clone it to get // the new axis if (noteIdRef != null) { if (NoteObj.containsKey(noteIdRef)) { BaseObject refNoteObj = (BaseObject) NoteObj.get(noteIdRef); try { newnote = (Note) refNoteObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone note object. Aborting read."); System.exit(-1); } // override attrs with those in passed list newnote.setXMLAttributes(attrs); newnote.setNoteId(findUniqueIdName(NoteObj, newnote.getNoteId())); NoteObj.put(newnote.getNoteId(), newnote); // note shouldnt have noteId from the parent } else { Log.warnln("Error: Reader got a note with NoteIdRef=\""+noteIdRef+"\" but no previous note has that id! Ignoring add note request."); return (Object) null; } } // add this object to parent object if( parentNodeName.equals(XDFNodeName.NOTES) ) { // only NOTES objects appear in arrays, so we can // just add to the current array CurrentArray.addNote(newnote); } else if ( parentNodeName.equals(XDFNodeName.FIELD) ) { LastFieldObject.addNote(newnote); } else if ( parentNodeName.equals(XDFNodeName.PARAMETER) ) { LastParameterObject.addNote(newnote); } else { Log.warnln( "Unknown parent node: "+parentNodeName+" for note. Ignoring."); } LastNoteObject = newnote; return newnote; }
3,101
public Object action (SaxDocumentHandler handler, AttributeList attrs) { // if this is still defined, we havent init'd an // XMLDataIOStyle object for this array yet, do it now. if ( !(DataIOStyleAttribs.isEmpty()) ) { FormattedXMLDataIOStyle readObj = new FormattedXMLDataIOStyle (CurrentArray, DataIOStyleAttribs); // readObj.setXMLAttributes(DataIOStyleAttribs); CurrentArray.setXMLDataIOStyle(readObj); DataIOStyleAttribs = new Hashtable(); // clear table CurrentFormatObjectList.add(readObj); } // okey, now that that is taken care off, we will go // get the current format (read) object, and add the readCell // command to it. Object formatObj = (Object) CurrentFormatObjectList.get(CurrentFormatObjectList.size()-1); ReadCellFormattedIOCmd readCellObj = new ReadCellFormattedIOCmd(); readCellObj.setXMLAttributes(attrs); if (formatObj instanceof FormattedXMLDataIOStyle) { return ((FormattedXMLDataIOStyle) formatObj).addFormatCommand(readCellObj); } else if ( formatObj instanceof RepeatFormattedIOCmd ) { return ((RepeatFormattedIOCmd) formatObj).addFormatCommand(readCellObj); } else { Log.warnln("Warning: cant add ReadCellFormattedIOCmd object to parent, ignoring request "); } return (Object) null; }
public Object action (SaxDocumentHandler handler, AttributeList attrs) { // if this is still defined, we havent init'd an // XMLDataIOStyle object for this array yet, do it now. if ( !(DataIOStyleAttribs.isEmpty()) ) { FormattedXMLDataIOStyle readObj = new FormattedXMLDataIOStyle (CurrentArray, DataIOStyleAttribs); String readId = readObj.getReadId(); String readIdRef = readObj.getReadIdRef(); if (readId != null) { if (ReadObj.containsKey(readId)) Log.warnln("More than one read node with readId=\""+readId+"\", using latest node." ); ReadObj.put(readId, readObj); } if (readIdRef != null) { if (ReadObj.containsKey(readIdRef)) { BaseObject refReadObj = (BaseObject) ReadObj.get(readIdRef); try { readObj = (FormattedXMLDataIOStyle) refReadObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone FormattedXMLDataIOStyle (read node) object. Aborting read."); System.exit(-1); } readObj.hashtableInitXDFAttributes(DataIOStyleAttribs); readObj.setReadId(findUniqueIdName(ReadObj, readObj.getReadId())); ReadObj.put(readObj.getReadId(), readObj); } else { Log.warnln("Error: Reader got a read node with ReadIdRef=\""+readIdRef+"\" but no previous read node has that id! Ignoring add request."); return (Object) null; } } // readObj.setXMLAttributes(DataIOStyleAttribs); CurrentArray.setXMLDataIOStyle(readObj); DataIOStyleAttribs = new Hashtable(); // clear table CurrentFormatObjectList.add(readObj); } // okey, now that that is taken care off, we will go // get the current format (read) object, and add the readCell // command to it. Object formatObj = (Object) CurrentFormatObjectList.get(CurrentFormatObjectList.size()-1); ReadCellFormattedIOCmd readCellObj = new ReadCellFormattedIOCmd(); readCellObj.setXMLAttributes(attrs); if (formatObj instanceof FormattedXMLDataIOStyle) { return ((FormattedXMLDataIOStyle) formatObj).addFormatCommand(readCellObj); } else if ( formatObj instanceof RepeatFormattedIOCmd ) { return ((RepeatFormattedIOCmd) formatObj).addFormatCommand(readCellObj); } else { Log.warnln("Warning: cant add ReadCellFormattedIOCmd object to parent, ignoring request "); } return (Object) null; }
3,102
private void addDataToCurrentArray ( Locator dataLocator, String thisString, DataFormat CurrentDataFormat ) {AxisInterface FastAxis = (AxisInterface) CurrentArray.getAxisList().get(0);AxisInterface SlowAxis = (AxisInterface) CurrentArray.getAxisList().get(1); // Note that we dont treat binary data at all try { Log.errorln("setData:["+thisString+"]["+dataLocator.getAxisLocation(FastAxis)+","+dataLocator.getAxisLocation(SlowAxis)+"]"); if ( CurrentDataFormat instanceof StringDataFormat) { CurrentArray.setData(dataLocator, thisString); } else if ( CurrentDataFormat instanceof FixedDataFormat) { Double number = new Double (thisString); CurrentArray.setData(dataLocator, number.doubleValue()); } else if ( CurrentDataFormat instanceof IntegerDataFormat) { Integer number = new Integer (thisString); CurrentArray.setData(dataLocator, number.intValue()); } else if ( CurrentDataFormat instanceof ExponentialDataFormat) { // hurm.. this is a stop-gap. Exponential format needs to be // preserved better than this. -b.t. Double number = new Double (thisString); CurrentArray.setData(dataLocator, number.doubleValue()); } else { Log.warnln("The dataFormat:"+CurrentDataFormat.toString()+" is not allowed in tagged data."); Log.warnln("Unable to setData:["+thisString+"], ignoring request"); } } catch (SetDataException e) { // bizarre error. Cant add data (out of memory??) :P Log.errorln("Unable to setData:["+thisString+"], ignoring request"); Log.printStackTrace(e); } }
private void addDataToCurrentArray ( Locator dataLocator, String thisString, DataFormat CurrentDataFormat ) {AxisInterface FastAxis = (AxisInterface) CurrentArray.getAxisList().get(0);AxisInterface SlowAxis = (AxisInterface) CurrentArray.getAxisList().get(1); // Note that we dont treat binary data at all try { Log.errorln("setData:["+thisString+"]["+dataLocator.getAxisLocation(FastAxis)+","+dataLocator.getAxisLocation(SlowAxis)+"]"); if ( CurrentDataFormat instanceof StringDataFormat) { CurrentArray.setData(dataLocator, thisString); } else if ( CurrentDataFormat instanceof FixedDataFormat) { Double number = new Double (thisString); CurrentArray.setData(dataLocator, number.doubleValue()); } else if ( CurrentDataFormat instanceof IntegerDataFormat) { Integer number = new Integer (thisString); CurrentArray.setData(dataLocator, number.intValue()); } else if ( CurrentDataFormat instanceof ExponentialDataFormat) { // hurm.. this is a stop-gap. Exponential format needs to be // preserved better than this. -b.t. Double number = new Double (thisString); CurrentArray.setData(dataLocator, number.doubleValue()); } else { Log.warnln("The dataFormat:"+CurrentDataFormat.toString()+" is not allowed in tagged data."); Log.warnln("Unable to setData:["+thisString+"], ignoring request"); } } catch (SetDataException e) { // bizarre error. Cant add data (out of memory??) :P Log.errorln("Unable to setData:["+thisString+"], ignoring request"); Log.printStackTrace(e); } }
3,103
private void addDataToCurrentArray ( Locator dataLocator, String thisString, DataFormat CurrentDataFormat ) {AxisInterface FastAxis = (AxisInterface) CurrentArray.getAxisList().get(0);AxisInterface SlowAxis = (AxisInterface) CurrentArray.getAxisList().get(1); // Note that we dont treat binary data at all try { Log.errorln("setData:["+thisString+"]["+dataLocator.getAxisLocation(FastAxis)+","+dataLocator.getAxisLocation(SlowAxis)+"]"); if ( CurrentDataFormat instanceof StringDataFormat) { CurrentArray.setData(dataLocator, thisString); } else if ( CurrentDataFormat instanceof FixedDataFormat) { Double number = new Double (thisString); CurrentArray.setData(dataLocator, number.doubleValue()); } else if ( CurrentDataFormat instanceof IntegerDataFormat) { Integer number = new Integer (thisString); CurrentArray.setData(dataLocator, number.intValue()); } else if ( CurrentDataFormat instanceof ExponentialDataFormat) { // hurm.. this is a stop-gap. Exponential format needs to be // preserved better than this. -b.t. Double number = new Double (thisString); CurrentArray.setData(dataLocator, number.doubleValue()); } else { Log.warnln("The dataFormat:"+CurrentDataFormat.toString()+" is not allowed in tagged data."); Log.warnln("Unable to setData:["+thisString+"], ignoring request"); } } catch (SetDataException e) { // bizarre error. Cant add data (out of memory??) :P Log.errorln("Unable to setData:["+thisString+"], ignoring request"); Log.printStackTrace(e); } }
private void addDataToCurrentArray ( Locator dataLocator, String thisString, DataFormat CurrentDataFormat ) {AxisInterface FastAxis = (AxisInterface) CurrentArray.getAxisList().get(0);AxisInterface SlowAxis = (AxisInterface) CurrentArray.getAxisList().get(1); // Note that we dont treat binary data at all try { if ( CurrentDataFormat instanceof StringDataFormat) { CurrentArray.setData(dataLocator, thisString); } else if ( CurrentDataFormat instanceof FixedDataFormat) { Double number = new Double (thisString); CurrentArray.setData(dataLocator, number.doubleValue()); } else if ( CurrentDataFormat instanceof IntegerDataFormat) { Integer number = new Integer (thisString); CurrentArray.setData(dataLocator, number.intValue()); } else if ( CurrentDataFormat instanceof ExponentialDataFormat) { // hurm.. this is a stop-gap. Exponential format needs to be // preserved better than this. -b.t. Double number = new Double (thisString); CurrentArray.setData(dataLocator, number.doubleValue()); } else { Log.warnln("The dataFormat:"+CurrentDataFormat.toString()+" is not allowed in tagged data."); Log.warnln("Unable to setData:["+thisString+"], ignoring request"); } } catch (SetDataException e) { // bizarre error. Cant add data (out of memory??) :P Log.errorln("Unable to setData:["+thisString+"], ignoring request"); Log.printStackTrace(e); } }
3,104
private ArrayList formattedSplitStringIntoStringObjects ( String data , FormattedXMLDataIOStyle readObj ) { ArrayList stringObjList = new ArrayList(); List commandList = readObj.getCommands(); DataFormat dataFormat[] = CurrentArray.getDataFormatList(); int dataPosition = 0; int dataLength = data.length(); int currentDataFormat = 0; int nrofDataFormat = dataFormat.length; Log.debugln("in formattedSplitString, data :["+data+"]"); // the extraction loop // whip thru the data string, either ignoring or accepting // characters in the string as directed by the formatCmdList while (dataPosition < dataLength) { Iterator formatIter = commandList.iterator(); while (formatIter.hasNext()) { FormattedIOCmd thisCommand = (FormattedIOCmd) formatIter.next(); if (thisCommand instanceof ReadCellFormattedIOCmd) // ReadCell ==> read some data { DataFormat formatObj = dataFormat[currentDataFormat]; int endDataPosition = dataPosition + formatObj.numOfBytes(); // add in our object String thisData = data.substring(dataPosition,endDataPosition); // remove leading whitespace from what will be non-string data. if (Character.isWhitespace(thisData.charAt(0)) && !(formatObj instanceof StringDataFormat)) thisData = trimLeadingWhitespace(thisData); Log.debugln("Got Data:["+thisData+"] ("+dataPosition+","+endDataPosition+")"); stringObjList.add(thisData); dataPosition = endDataPosition; // advance our pointer to the current DataFormat if (nrofDataFormat > 1) if (currentDataFormat == (nrofDataFormat - 1)) currentDataFormat = 0; else currentDataFormat++; } else if (thisCommand instanceof SkipCharFormattedIOCmd) // SkipChar ==> just adv. dataPointer { dataPosition += ((SkipCharFormattedIOCmd) thisCommand).getCount().intValue(); } else { Log.errorln("Unknown FormattedIOCmd, aborting formatted read."); // needed check ? break; } } } return stringObjList; }
private ArrayList formattedSplitStringIntoStringObjects ( String data , FormattedXMLDataIOStyle readObj ) { ArrayList stringObjList = new ArrayList(); List commandList = readObj.getCommands(); DataFormat dataFormat[] = CurrentArray.getDataFormatList(); int dataPosition = 0; int dataLength = data.length(); int currentDataFormat = 0; int nrofDataFormat = dataFormat.length; Log.debugln("in formattedSplitString, data :["+data+"]"); // the extraction loop // whip thru the data string, either ignoring or accepting // characters in the string as directed by the formatCmdList while (dataPosition < dataLength) { Iterator formatIter = commandList.iterator(); while (formatIter.hasNext()) { FormattedIOCmd thisCommand = (FormattedIOCmd) formatIter.next(); if (thisCommand instanceof ReadCellFormattedIOCmd) // ReadCell ==> read some data { DataFormat formatObj = dataFormat[currentDataFormat]; int endDataPosition = dataPosition + formatObj.numOfBytes(); // add in our object String thisData = data.substring(dataPosition,endDataPosition); // remove leading whitespace from what will be non-string data. if (Character.isWhitespace(thisData.charAt(0)) && !(formatObj instanceof StringDataFormat)) thisData = trimLeadingWhitespace(thisData); Log.debugln("Got Data:["+thisData+"] ("+dataPosition+","+endDataPosition+")"); stringObjList.add(thisData); dataPosition = endDataPosition; // advance our pointer to the current DataFormat if (nrofDataFormat > 1) if (currentDataFormat == (nrofDataFormat - 1)) currentDataFormat = 0; else currentDataFormat++; } else if (thisCommand instanceof SkipCharFormattedIOCmd) // SkipChar ==> just adv. dataPointer { dataPosition += ((SkipCharFormattedIOCmd) thisCommand).getCount().intValue(); } else { Log.errorln("Unknown FormattedIOCmd, aborting formatted read."); // needed check ? break; } } } return stringObjList; }
3,105
private ArrayList formattedSplitStringIntoStringObjects ( String data , FormattedXMLDataIOStyle readObj ) { ArrayList stringObjList = new ArrayList(); List commandList = readObj.getCommands(); DataFormat dataFormat[] = CurrentArray.getDataFormatList(); int dataPosition = 0; int dataLength = data.length(); int currentDataFormat = 0; int nrofDataFormat = dataFormat.length; Log.debugln("in formattedSplitString, data :["+data+"]"); // the extraction loop // whip thru the data string, either ignoring or accepting // characters in the string as directed by the formatCmdList while (dataPosition < dataLength) { Iterator formatIter = commandList.iterator(); while (formatIter.hasNext()) { FormattedIOCmd thisCommand = (FormattedIOCmd) formatIter.next(); if (thisCommand instanceof ReadCellFormattedIOCmd) // ReadCell ==> read some data { DataFormat formatObj = dataFormat[currentDataFormat]; int endDataPosition = dataPosition + formatObj.numOfBytes(); // add in our object String thisData = data.substring(dataPosition,endDataPosition); // remove leading whitespace from what will be non-string data. if (Character.isWhitespace(thisData.charAt(0)) && !(formatObj instanceof StringDataFormat)) thisData = trimLeadingWhitespace(thisData); Log.debugln("Got Data:["+thisData+"] ("+dataPosition+","+endDataPosition+")"); stringObjList.add(thisData); dataPosition = endDataPosition; // advance our pointer to the current DataFormat if (nrofDataFormat > 1) if (currentDataFormat == (nrofDataFormat - 1)) currentDataFormat = 0; else currentDataFormat++; } else if (thisCommand instanceof SkipCharFormattedIOCmd) // SkipChar ==> just adv. dataPointer { dataPosition += ((SkipCharFormattedIOCmd) thisCommand).getCount().intValue(); } else { Log.errorln("Unknown FormattedIOCmd, aborting formatted read."); // needed check ? break; } } } return stringObjList; }
private ArrayList formattedSplitStringIntoStringObjects ( String data , FormattedXMLDataIOStyle readObj ) { ArrayList stringObjList = new ArrayList(); List commandList = readObj.getCommands(); DataFormat dataFormat[] = CurrentArray.getDataFormatList(); int dataPosition = 0; int dataLength = data.length(); int currentDataFormat = 0; int nrofDataFormat = dataFormat.length; Log.debugln("in formattedSplitString, data :["+data+"]"); // the extraction loop // whip thru the data string, either ignoring or accepting // characters in the string as directed by the formatCmdList while (dataPosition < dataLength) { Iterator formatIter = commandList.iterator(); while (formatIter.hasNext()) { FormattedIOCmd thisCommand = (FormattedIOCmd) formatIter.next(); if (thisCommand instanceof ReadCellFormattedIOCmd) // ReadCell ==> read some data { DataFormat formatObj = dataFormat[currentDataFormat]; int endDataPosition = dataPosition + formatObj.numOfBytes(); // add in our object String thisData = data.substring(dataPosition,endDataPosition); // remove leading whitespace from what will be non-string data. if (Character.isWhitespace(thisData.charAt(0)) && !(formatObj instanceof StringDataFormat)) thisData = trimLeadingWhitespace(thisData); Log.debugln("Got Formatted DataCell:["+thisData+"]"); stringObjList.add(thisData); dataPosition = endDataPosition; // advance our pointer to the current DataFormat if (nrofDataFormat > 1) if (currentDataFormat == (nrofDataFormat - 1)) currentDataFormat = 0; else currentDataFormat++; } else if (thisCommand instanceof SkipCharFormattedIOCmd) // SkipChar ==> just adv. dataPointer { dataPosition += ((SkipCharFormattedIOCmd) thisCommand).getCount().intValue(); } else { Log.errorln("Unknown FormattedIOCmd, aborting formatted read."); // needed check ? break; } } } return stringObjList; }
3,106
public void remove(Component component) { super.remove(component); }
public void remove(Component component) { int index = indexOfComponent(component); if (index == -1) { Component[] cs = getComponents(); for (int i = 0; i< cs.length; i++) if (cs[i] == component) super.remove(i); } else removeTabAt(index); }
3,107
public void setModel(SingleSelectionModel model) { if (model != this.model) { SingleSelectionModel oldModel = this.model; this.model.removeChangeListener(changeListener); this.model = model; this.model.addChangeListener(changeListener); firePropertyChange("model", oldModel, this.model); } }
public void setModel(SingleSelectionModel m) { if (model != this.model) { SingleSelectionModel oldModel = this.model; this.model.removeChangeListener(changeListener); this.model = model; this.model.addChangeListener(changeListener); firePropertyChange("model", oldModel, this.model); } }
3,108
public void setModel(SingleSelectionModel model) { if (model != this.model) { SingleSelectionModel oldModel = this.model; this.model.removeChangeListener(changeListener); this.model = model; this.model.addChangeListener(changeListener); firePropertyChange("model", oldModel, this.model); } }
public void setModel(SingleSelectionModel model) { if (m != model) { SingleSelectionModel oldModel = this.model; this.model.removeChangeListener(changeListener); this.model = model; this.model.addChangeListener(changeListener); firePropertyChange("model", oldModel, this.model); } }
3,109
public void setModel(SingleSelectionModel model) { if (model != this.model) { SingleSelectionModel oldModel = this.model; this.model.removeChangeListener(changeListener); this.model = model; this.model.addChangeListener(changeListener); firePropertyChange("model", oldModel, this.model); } }
public void setModel(SingleSelectionModel model) { if (model != this.model) { SingleSelectionModel oldModel = this.model; this.model.removeChangeListener(changeListener); this.model = model; this.model.addChangeListener(changeListener); firePropertyChange("model", oldModel, this.model); } }
3,110
protected void decodeLineStyle(Object lineStyleFlag) throws NotImplementedException { // FIXME: not implemented }
protected void decodeLineStyle(Object lineStyleFlag) { // FIXME: not implemented }
3,112
protected void decodeLineStyle(Object lineStyleFlag) throws NotImplementedException { // FIXME: not implemented }
if (lineStyleFlag == null || lineStyleFlag.equals(LINE_STYLE_VALUE_ANGLED)) lineStyle = LINE_STYLE_ANGLED; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_HORIZONTAL)) lineStyle = LINE_STYLE_HORIZONTAL; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_NONE)) lineStyle = LINE_STYLE_NONE; else lineStyle = LINE_STYLE_ANGLED; if (lineStyleFlag == null || lineStyleFlag.equals(LINE_STYLE_VALUE_ANGLED)) lineStyle = LINE_STYLE_ANGLED; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_HORIZONTAL)) lineStyle = LINE_STYLE_HORIZONTAL; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_NONE)) lineStyle = LINE_STYLE_NONE; else lineStyle = LINE_STYLE_ANGLED; protectedif (lineStyleFlag == null || lineStyleFlag.equals(LINE_STYLE_VALUE_ANGLED)) lineStyle = LINE_STYLE_ANGLED; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_HORIZONTAL)) lineStyle = LINE_STYLE_HORIZONTAL; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_NONE)) lineStyle = LINE_STYLE_NONE; else lineStyle = LINE_STYLE_ANGLED; voidif (lineStyleFlag == null || lineStyleFlag.equals(LINE_STYLE_VALUE_ANGLED)) lineStyle = LINE_STYLE_ANGLED; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_HORIZONTAL)) lineStyle = LINE_STYLE_HORIZONTAL; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_NONE)) lineStyle = LINE_STYLE_NONE; else lineStyle = LINE_STYLE_ANGLED; decodeLineStyle(Objectif (lineStyleFlag == null || lineStyleFlag.equals(LINE_STYLE_VALUE_ANGLED)) lineStyle = LINE_STYLE_ANGLED; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_HORIZONTAL)) lineStyle = LINE_STYLE_HORIZONTAL; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_NONE)) lineStyle = LINE_STYLE_NONE; else lineStyle = LINE_STYLE_ANGLED; lineStyleFlag)if (lineStyleFlag == null || lineStyleFlag.equals(LINE_STYLE_VALUE_ANGLED)) lineStyle = LINE_STYLE_ANGLED; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_HORIZONTAL)) lineStyle = LINE_STYLE_HORIZONTAL; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_NONE)) lineStyle = LINE_STYLE_NONE; else lineStyle = LINE_STYLE_ANGLED; if (lineStyleFlag == null || lineStyleFlag.equals(LINE_STYLE_VALUE_ANGLED)) lineStyle = LINE_STYLE_ANGLED; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_HORIZONTAL)) lineStyle = LINE_STYLE_HORIZONTAL; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_NONE)) lineStyle = LINE_STYLE_NONE; else lineStyle = LINE_STYLE_ANGLED; if (lineStyleFlag == null || lineStyleFlag.equals(LINE_STYLE_VALUE_ANGLED)) lineStyle = LINE_STYLE_ANGLED; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_HORIZONTAL)) lineStyle = LINE_STYLE_HORIZONTAL; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_NONE)) lineStyle = LINE_STYLE_NONE; else lineStyle = LINE_STYLE_ANGLED; if (lineStyleFlag == null || lineStyleFlag.equals(LINE_STYLE_VALUE_ANGLED)) lineStyle = LINE_STYLE_ANGLED; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_HORIZONTAL)) lineStyle = LINE_STYLE_HORIZONTAL; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_NONE)) lineStyle = LINE_STYLE_NONE; else lineStyle = LINE_STYLE_ANGLED; throwsif (lineStyleFlag == null || lineStyleFlag.equals(LINE_STYLE_VALUE_ANGLED)) lineStyle = LINE_STYLE_ANGLED; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_HORIZONTAL)) lineStyle = LINE_STYLE_HORIZONTAL; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_NONE)) lineStyle = LINE_STYLE_NONE; else lineStyle = LINE_STYLE_ANGLED; NotImplementedExceptionif (lineStyleFlag == null || lineStyleFlag.equals(LINE_STYLE_VALUE_ANGLED)) lineStyle = LINE_STYLE_ANGLED; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_HORIZONTAL)) lineStyle = LINE_STYLE_HORIZONTAL; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_NONE)) lineStyle = LINE_STYLE_NONE; else lineStyle = LINE_STYLE_ANGLED; if (lineStyleFlag == null || lineStyleFlag.equals(LINE_STYLE_VALUE_ANGLED)) lineStyle = LINE_STYLE_ANGLED; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_HORIZONTAL)) lineStyle = LINE_STYLE_HORIZONTAL; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_NONE)) lineStyle = LINE_STYLE_NONE; else lineStyle = LINE_STYLE_ANGLED; {if (lineStyleFlag == null || lineStyleFlag.equals(LINE_STYLE_VALUE_ANGLED)) lineStyle = LINE_STYLE_ANGLED; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_HORIZONTAL)) lineStyle = LINE_STYLE_HORIZONTAL; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_NONE)) lineStyle = LINE_STYLE_NONE; else lineStyle = LINE_STYLE_ANGLED; if (lineStyleFlag == null || lineStyleFlag.equals(LINE_STYLE_VALUE_ANGLED)) lineStyle = LINE_STYLE_ANGLED; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_HORIZONTAL)) lineStyle = LINE_STYLE_HORIZONTAL; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_NONE)) lineStyle = LINE_STYLE_NONE; else lineStyle = LINE_STYLE_ANGLED; if (lineStyleFlag == null || lineStyleFlag.equals(LINE_STYLE_VALUE_ANGLED)) lineStyle = LINE_STYLE_ANGLED; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_HORIZONTAL)) lineStyle = LINE_STYLE_HORIZONTAL; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_NONE)) lineStyle = LINE_STYLE_NONE; else lineStyle = LINE_STYLE_ANGLED; if (lineStyleFlag == null || lineStyleFlag.equals(LINE_STYLE_VALUE_ANGLED)) lineStyle = LINE_STYLE_ANGLED; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_HORIZONTAL)) lineStyle = LINE_STYLE_HORIZONTAL; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_NONE)) lineStyle = LINE_STYLE_NONE; else lineStyle = LINE_STYLE_ANGLED; //if (lineStyleFlag == null || lineStyleFlag.equals(LINE_STYLE_VALUE_ANGLED)) lineStyle = LINE_STYLE_ANGLED; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_HORIZONTAL)) lineStyle = LINE_STYLE_HORIZONTAL; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_NONE)) lineStyle = LINE_STYLE_NONE; else lineStyle = LINE_STYLE_ANGLED; FIXME:if (lineStyleFlag == null || lineStyleFlag.equals(LINE_STYLE_VALUE_ANGLED)) lineStyle = LINE_STYLE_ANGLED; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_HORIZONTAL)) lineStyle = LINE_STYLE_HORIZONTAL; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_NONE)) lineStyle = LINE_STYLE_NONE; else lineStyle = LINE_STYLE_ANGLED; notif (lineStyleFlag == null || lineStyleFlag.equals(LINE_STYLE_VALUE_ANGLED)) lineStyle = LINE_STYLE_ANGLED; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_HORIZONTAL)) lineStyle = LINE_STYLE_HORIZONTAL; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_NONE)) lineStyle = LINE_STYLE_NONE; else lineStyle = LINE_STYLE_ANGLED; implementedif (lineStyleFlag == null || lineStyleFlag.equals(LINE_STYLE_VALUE_ANGLED)) lineStyle = LINE_STYLE_ANGLED; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_HORIZONTAL)) lineStyle = LINE_STYLE_HORIZONTAL; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_NONE)) lineStyle = LINE_STYLE_NONE; else lineStyle = LINE_STYLE_ANGLED; if (lineStyleFlag == null || lineStyleFlag.equals(LINE_STYLE_VALUE_ANGLED)) lineStyle = LINE_STYLE_ANGLED; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_HORIZONTAL)) lineStyle = LINE_STYLE_HORIZONTAL; else if (lineStyleFlag.equals(LINE_STYLE_VALUE_NONE)) lineStyle = LINE_STYLE_NONE; else lineStyle = LINE_STYLE_ANGLED; }
3,113
public void installUI(JComponent c) { // TODO: What to do here, if anything? super.installUI(c); }
publicvoidinstallUI(JComponentc){//TODO:Whattodohere,ifanything?super.installUI(c);}
3,114
protected void paintHorizontalSeparators(Graphics g, JComponent c) throws NotImplementedException { // FIXME: not implemented }
protected void paintHorizontalSeparators(Graphics g, JComponent c) { // FIXME: not implemented }
3,118
protected void paintHorizontalSeparators(Graphics g, JComponent c) throws NotImplementedException { // FIXME: not implemented }
g.setColor(UIManager.getColor("Tree.line")); Rectangle clip = g.getClipBounds(); int row0 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y)); int row1 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y + clip.height - 1)); if (row0 >= 0 && row1 >= 0) { for (int i = row0; i <= row1; i++) { TreePath p = getPathForRow(tree, i); if (p != null && p.getPathCount() == 2) { Rectangle r = getPathBounds(tree, getPathForRow(tree, i)); if (r != null) { g.drawLine(clip.x, r.y, clip.x + clip.width, r.y); } } } } g.setColor(UIManager.getColor("Tree.line")); Rectangle clip = g.getClipBounds(); int row0 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y)); int row1 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y + clip.height - 1)); if (row0 >= 0 && row1 >= 0) { for (int i = row0; i <= row1; i++) { TreePath p = getPathForRow(tree, i); if (p != null && p.getPathCount() == 2) { Rectangle r = getPathBounds(tree, getPathForRow(tree, i)); if (r != null) { g.drawLine(clip.x, r.y, clip.x + clip.width, r.y); } } } } protectedg.setColor(UIManager.getColor("Tree.line")); Rectangle clip = g.getClipBounds(); int row0 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y)); int row1 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y + clip.height - 1)); if (row0 >= 0 && row1 >= 0) { for (int i = row0; i <= row1; i++) { TreePath p = getPathForRow(tree, i); if (p != null && p.getPathCount() == 2) { Rectangle r = getPathBounds(tree, getPathForRow(tree, i)); if (r != null) { g.drawLine(clip.x, r.y, clip.x + clip.width, r.y); } } } } voidg.setColor(UIManager.getColor("Tree.line")); Rectangle clip = g.getClipBounds(); int row0 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y)); int row1 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y + clip.height - 1)); if (row0 >= 0 && row1 >= 0) { for (int i = row0; i <= row1; i++) { TreePath p = getPathForRow(tree, i); if (p != null && p.getPathCount() == 2) { Rectangle r = getPathBounds(tree, getPathForRow(tree, i)); if (r != null) { g.drawLine(clip.x, r.y, clip.x + clip.width, r.y); } } } } paintHorizontalSeparators(Graphicsg.setColor(UIManager.getColor("Tree.line")); Rectangle clip = g.getClipBounds(); int row0 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y)); int row1 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y + clip.height - 1)); if (row0 >= 0 && row1 >= 0) { for (int i = row0; i <= row1; i++) { TreePath p = getPathForRow(tree, i); if (p != null && p.getPathCount() == 2) { Rectangle r = getPathBounds(tree, getPathForRow(tree, i)); if (r != null) { g.drawLine(clip.x, r.y, clip.x + clip.width, r.y); } } } } g,g.setColor(UIManager.getColor("Tree.line")); Rectangle clip = g.getClipBounds(); int row0 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y)); int row1 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y + clip.height - 1)); if (row0 >= 0 && row1 >= 0) { for (int i = row0; i <= row1; i++) { TreePath p = getPathForRow(tree, i); if (p != null && p.getPathCount() == 2) { Rectangle r = getPathBounds(tree, getPathForRow(tree, i)); if (r != null) { g.drawLine(clip.x, r.y, clip.x + clip.width, r.y); } } } } JComponentg.setColor(UIManager.getColor("Tree.line")); Rectangle clip = g.getClipBounds(); int row0 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y)); int row1 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y + clip.height - 1)); if (row0 >= 0 && row1 >= 0) { for (int i = row0; i <= row1; i++) { TreePath p = getPathForRow(tree, i); if (p != null && p.getPathCount() == 2) { Rectangle r = getPathBounds(tree, getPathForRow(tree, i)); if (r != null) { g.drawLine(clip.x, r.y, clip.x + clip.width, r.y); } } } } c)g.setColor(UIManager.getColor("Tree.line")); Rectangle clip = g.getClipBounds(); int row0 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y)); int row1 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y + clip.height - 1)); if (row0 >= 0 && row1 >= 0) { for (int i = row0; i <= row1; i++) { TreePath p = getPathForRow(tree, i); if (p != null && p.getPathCount() == 2) { Rectangle r = getPathBounds(tree, getPathForRow(tree, i)); if (r != null) { g.drawLine(clip.x, r.y, clip.x + clip.width, r.y); } } } } g.setColor(UIManager.getColor("Tree.line")); Rectangle clip = g.getClipBounds(); int row0 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y)); int row1 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y + clip.height - 1)); if (row0 >= 0 && row1 >= 0) { for (int i = row0; i <= row1; i++) { TreePath p = getPathForRow(tree, i); if (p != null && p.getPathCount() == 2) { Rectangle r = getPathBounds(tree, getPathForRow(tree, i)); if (r != null) { g.drawLine(clip.x, r.y, clip.x + clip.width, r.y); } } } } g.setColor(UIManager.getColor("Tree.line")); Rectangle clip = g.getClipBounds(); int row0 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y)); int row1 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y + clip.height - 1)); if (row0 >= 0 && row1 >= 0) { for (int i = row0; i <= row1; i++) { TreePath p = getPathForRow(tree, i); if (p != null && p.getPathCount() == 2) { Rectangle r = getPathBounds(tree, getPathForRow(tree, i)); if (r != null) { g.drawLine(clip.x, r.y, clip.x + clip.width, r.y); } } } } g.setColor(UIManager.getColor("Tree.line")); Rectangle clip = g.getClipBounds(); int row0 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y)); int row1 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y + clip.height - 1)); if (row0 >= 0 && row1 >= 0) { for (int i = row0; i <= row1; i++) { TreePath p = getPathForRow(tree, i); if (p != null && p.getPathCount() == 2) { Rectangle r = getPathBounds(tree, getPathForRow(tree, i)); if (r != null) { g.drawLine(clip.x, r.y, clip.x + clip.width, r.y); } } } } throwsg.setColor(UIManager.getColor("Tree.line")); Rectangle clip = g.getClipBounds(); int row0 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y)); int row1 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y + clip.height - 1)); if (row0 >= 0 && row1 >= 0) { for (int i = row0; i <= row1; i++) { TreePath p = getPathForRow(tree, i); if (p != null && p.getPathCount() == 2) { Rectangle r = getPathBounds(tree, getPathForRow(tree, i)); if (r != null) { g.drawLine(clip.x, r.y, clip.x + clip.width, r.y); } } } } NotImplementedExceptiong.setColor(UIManager.getColor("Tree.line")); Rectangle clip = g.getClipBounds(); int row0 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y)); int row1 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y + clip.height - 1)); if (row0 >= 0 && row1 >= 0) { for (int i = row0; i <= row1; i++) { TreePath p = getPathForRow(tree, i); if (p != null && p.getPathCount() == 2) { Rectangle r = getPathBounds(tree, getPathForRow(tree, i)); if (r != null) { g.drawLine(clip.x, r.y, clip.x + clip.width, r.y); } } } } g.setColor(UIManager.getColor("Tree.line")); Rectangle clip = g.getClipBounds(); int row0 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y)); int row1 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y + clip.height - 1)); if (row0 >= 0 && row1 >= 0) { for (int i = row0; i <= row1; i++) { TreePath p = getPathForRow(tree, i); if (p != null && p.getPathCount() == 2) { Rectangle r = getPathBounds(tree, getPathForRow(tree, i)); if (r != null) { g.drawLine(clip.x, r.y, clip.x + clip.width, r.y); } } } } {g.setColor(UIManager.getColor("Tree.line")); Rectangle clip = g.getClipBounds(); int row0 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y)); int row1 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y + clip.height - 1)); if (row0 >= 0 && row1 >= 0) { for (int i = row0; i <= row1; i++) { TreePath p = getPathForRow(tree, i); if (p != null && p.getPathCount() == 2) { Rectangle r = getPathBounds(tree, getPathForRow(tree, i)); if (r != null) { g.drawLine(clip.x, r.y, clip.x + clip.width, r.y); } } } } g.setColor(UIManager.getColor("Tree.line")); Rectangle clip = g.getClipBounds(); int row0 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y)); int row1 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y + clip.height - 1)); if (row0 >= 0 && row1 >= 0) { for (int i = row0; i <= row1; i++) { TreePath p = getPathForRow(tree, i); if (p != null && p.getPathCount() == 2) { Rectangle r = getPathBounds(tree, getPathForRow(tree, i)); if (r != null) { g.drawLine(clip.x, r.y, clip.x + clip.width, r.y); } } } } g.setColor(UIManager.getColor("Tree.line")); Rectangle clip = g.getClipBounds(); int row0 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y)); int row1 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y + clip.height - 1)); if (row0 >= 0 && row1 >= 0) { for (int i = row0; i <= row1; i++) { TreePath p = getPathForRow(tree, i); if (p != null && p.getPathCount() == 2) { Rectangle r = getPathBounds(tree, getPathForRow(tree, i)); if (r != null) { g.drawLine(clip.x, r.y, clip.x + clip.width, r.y); } } } } g.setColor(UIManager.getColor("Tree.line")); Rectangle clip = g.getClipBounds(); int row0 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y)); int row1 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y + clip.height - 1)); if (row0 >= 0 && row1 >= 0) { for (int i = row0; i <= row1; i++) { TreePath p = getPathForRow(tree, i); if (p != null && p.getPathCount() == 2) { Rectangle r = getPathBounds(tree, getPathForRow(tree, i)); if (r != null) { g.drawLine(clip.x, r.y, clip.x + clip.width, r.y); } } } } //g.setColor(UIManager.getColor("Tree.line")); Rectangle clip = g.getClipBounds(); int row0 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y)); int row1 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y + clip.height - 1)); if (row0 >= 0 && row1 >= 0) { for (int i = row0; i <= row1; i++) { TreePath p = getPathForRow(tree, i); if (p != null && p.getPathCount() == 2) { Rectangle r = getPathBounds(tree, getPathForRow(tree, i)); if (r != null) { g.drawLine(clip.x, r.y, clip.x + clip.width, r.y); } } } } FIXME:g.setColor(UIManager.getColor("Tree.line")); Rectangle clip = g.getClipBounds(); int row0 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y)); int row1 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y + clip.height - 1)); if (row0 >= 0 && row1 >= 0) { for (int i = row0; i <= row1; i++) { TreePath p = getPathForRow(tree, i); if (p != null && p.getPathCount() == 2) { Rectangle r = getPathBounds(tree, getPathForRow(tree, i)); if (r != null) { g.drawLine(clip.x, r.y, clip.x + clip.width, r.y); } } } } notg.setColor(UIManager.getColor("Tree.line")); Rectangle clip = g.getClipBounds(); int row0 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y)); int row1 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y + clip.height - 1)); if (row0 >= 0 && row1 >= 0) { for (int i = row0; i <= row1; i++) { TreePath p = getPathForRow(tree, i); if (p != null && p.getPathCount() == 2) { Rectangle r = getPathBounds(tree, getPathForRow(tree, i)); if (r != null) { g.drawLine(clip.x, r.y, clip.x + clip.width, r.y); } } } } implementedg.setColor(UIManager.getColor("Tree.line")); Rectangle clip = g.getClipBounds(); int row0 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y)); int row1 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y + clip.height - 1)); if (row0 >= 0 && row1 >= 0) { for (int i = row0; i <= row1; i++) { TreePath p = getPathForRow(tree, i); if (p != null && p.getPathCount() == 2) { Rectangle r = getPathBounds(tree, getPathForRow(tree, i)); if (r != null) { g.drawLine(clip.x, r.y, clip.x + clip.width, r.y); } } } } g.setColor(UIManager.getColor("Tree.line")); Rectangle clip = g.getClipBounds(); int row0 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y)); int row1 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y + clip.height - 1)); if (row0 >= 0 && row1 >= 0) { for (int i = row0; i <= row1; i++) { TreePath p = getPathForRow(tree, i); if (p != null && p.getPathCount() == 2) { Rectangle r = getPathBounds(tree, getPathForRow(tree, i)); if (r != null) { g.drawLine(clip.x, r.y, clip.x + clip.width, r.y); } } } } }
3,119
public void uninstallUI(JComponent c) { // TODO: What to do here? super.uninstallUI(c); }
publicvoiduninstallUI(JComponentc){//TODO:Whattodohere?super.uninstallUI(c);}
3,121
protected void initKeys(Keys keys) { keys.setKey(1, new Key(KeyEvent.VK_ESCAPE)); keys.setKey(2, new Key('1', KeyEvent.VK_1, '!', KeyEvent.VK_EXCLAMATION_MARK)); keys.setKey(3, new Key('2', KeyEvent.VK_2, '@', KeyEvent.VK_AT)); keys.setKey(4, new Key('3', KeyEvent.VK_3, '#', KeyEvent.VK_NUMBER_SIGN, '', KeyEvent.VK_3)); keys.setKey(5, new Key('4', KeyEvent.VK_4, '$', KeyEvent.VK_DOLLAR)); keys.setKey(6, new Key('5', '%', KeyEvent.VK_5)); keys.setKey(7, new Key('6', '^', KeyEvent.VK_6)); keys.setKey(8, new Key('7', '&', KeyEvent.VK_7)); keys.setKey(9, new Key('8', KeyEvent.VK_8, '*', KeyEvent.VK_MULTIPLY)); keys.setKey(10, new Key('9', KeyEvent.VK_9, '(', KeyEvent.VK_LEFT_PARENTHESIS)); keys.setKey(11, new Key('0', KeyEvent.VK_0, ')', KeyEvent.VK_RIGHT_PARENTHESIS)); keys.setKey(12, new Key('[', KeyEvent.VK_OPEN_BRACKET, '{', KeyEvent.VK_BRACELEFT)); keys.setKey(13, new Key(']', KeyEvent.VK_CLOSE_BRACKET, '}', KeyEvent.VK_BRACERIGHT)); keys.setKey(14, new Key('\b', KeyEvent.VK_BACK_SPACE)); keys.setKey(15, new Key('\t', KeyEvent.VK_TAB)); keys.setKey(16, new Key('\'',KeyEvent.VK_QUOTE, '\"', KeyEvent.VK_QUOTEDBL)); keys.setKey(17, new Key(',',KeyEvent.VK_COMMA, '<', KeyEvent.VK_LESS)); keys.setKey(18, new Key('.',KeyEvent.VK_PERIOD, '>', KeyEvent.VK_GREATER)); keys.setKey(19, new Key('p', 'P', KeyEvent.VK_P)); keys.setKey(20, new Key('y', 'Y', KeyEvent.VK_Y)); keys.setKey(21, new Key('f', 'F', KeyEvent.VK_F)); keys.setKey(22, new Key('g', 'G', KeyEvent.VK_G)); keys.setKey(23, new Key('c', 'C', KeyEvent.VK_C)); keys.setKey(24, new Key('r', 'R', KeyEvent.VK_R)); keys.setKey(25, new Key('l', 'L', KeyEvent.VK_L)); keys.setKey(26, new Key('/', '?',KeyEvent.VK_SLASH)); keys.setKey(27, new Key('=', KeyEvent.VK_EQUALS, '+', KeyEvent.VK_PLUS)); keys.setKey(28, new Key('\n', KeyEvent.VK_ENTER)); keys.setKey(29, new Key((char) 0, KeyEvent.VK_CONTROL)); keys.setKey(30, new Key('a', 'A', KeyEvent.VK_A)); keys.setKey(31, new Key('o', 'O', KeyEvent.VK_O)); keys.setKey(32, new Key('e', 'E', KeyEvent.VK_E)); keys.setKey(33, new Key('u', 'U', KeyEvent.VK_U)); keys.setKey(34, new Key('i', 'I', KeyEvent.VK_I)); keys.setKey(35, new Key('d', 'D', KeyEvent.VK_D)); keys.setKey(36, new Key('h', 'H', KeyEvent.VK_H)); keys.setKey(37, new Key('t', 'T', KeyEvent.VK_T)); keys.setKey(38, new Key('n', 'N', KeyEvent.VK_N)); keys.setKey(39, new Key('s', 'S',KeyEvent.VK_S));//KeyEvent.VK_SEMICOLON, ':', KeyEvent.VK_COLON)); keys.setKey(40, new Key("-".charAt(0), KeyEvent.VK_MINUS, '_', KeyEvent.VK_UNDERSCORE)); keys.setKey(41, new Key('`', '~', KeyEvent.VK_BACK_QUOTE)); keys.setKey(43, new Key('\\', '|', KeyEvent.VK_BACK_SLASH)); keys.setKey(44, new Key(';', KeyEvent.VK_SEMICOLON,':', KeyEvent.VK_COLON)); keys.setKey(45, new Key('q', 'Q', KeyEvent.VK_Q)); keys.setKey(46, new Key('j', 'J', KeyEvent.VK_J)); keys.setKey(47, new Key('k', 'K', KeyEvent.VK_K)); keys.setKey(48, new Key('x', 'X', KeyEvent.VK_X)); keys.setKey(49, new Key('b', 'B', KeyEvent.VK_B)); keys.setKey(50, new Key('m', 'M', KeyEvent.VK_M)); keys.setKey(51, new Key('w', 'M',KeyEvent.VK_M));//KeyEvent.VK_COMMA, '<', KeyEvent.VK_LESS)); keys.setKey(52, new Key('v', 'V',KeyEvent.VK_V));//KeyEvent.VK_PERIOD, '>', KeyEvent.VK_GREATER)); keys.setKey(53, new Key('z', 'Z', KeyEvent.VK_Z)); keys.setKey(55, new Key('*', KeyEvent.VK_MULTIPLY)); keys.setKey(57, new Key(' ', KeyEvent.VK_SPACE)); keys.setKey(71, new Key('7', KeyEvent.VK_NUMPAD7)); keys.setKey(72, new Key('8', KeyEvent.VK_NUMPAD8)); keys.setKey(73, new Key('9', KeyEvent.VK_NUMPAD9)); keys.setKey(74, new Key('-', KeyEvent.VK_SUBTRACT)); keys.setKey(75, new Key('4', KeyEvent.VK_NUMPAD4)); keys.setKey(76, new Key('5', KeyEvent.VK_NUMPAD5)); keys.setKey(77, new Key('6', KeyEvent.VK_NUMPAD6)); keys.setKey(78, new Key('+', KeyEvent.VK_ADD)); keys.setKey(79, new Key('1', KeyEvent.VK_NUMPAD1)); keys.setKey(80, new Key('2', KeyEvent.VK_NUMPAD2)); keys.setKey(81, new Key('3', KeyEvent.VK_NUMPAD3)); keys.setKey(82, new Key('0', KeyEvent.VK_NUMPAD0)); keys.setKey(83, new Key('.', KeyEvent.VK_DECIMAL)); keys.setKey(86, new Key('/', KeyEvent.VK_SLASH)); keys.setKey(42, new Key(KeyEvent.VK_SHIFT)); keys.setKey(54, new Key(KeyEvent.VK_SHIFT)); keys.setKey(56, new Key(KeyEvent.VK_ALT)); keys.setKey(58, new Key(KeyEvent.VK_CAPS_LOCK)); keys.setKey(59, new Key(KeyEvent.VK_F1)); keys.setKey(60, new Key(KeyEvent.VK_F2)); keys.setKey(61, new Key(KeyEvent.VK_F3)); keys.setKey(62, new Key(KeyEvent.VK_F4)); keys.setKey(63, new Key(KeyEvent.VK_F5)); keys.setKey(64, new Key(KeyEvent.VK_F6)); keys.setKey(65, new Key(KeyEvent.VK_F7)); keys.setKey(66, new Key(KeyEvent.VK_F8)); keys.setKey(67, new Key(KeyEvent.VK_F9)); keys.setKey(68, new Key(KeyEvent.VK_F10)); keys.setKey(69, new Key(KeyEvent.VK_NUM_LOCK)); keys.setKey(70, new Key(KeyEvent.VK_SCROLL_LOCK)); keys.setKey(87, new Key(KeyEvent.VK_F11)); keys.setKey(88, new Key(KeyEvent.VK_F12)); keys.setKey(96, new Key(KeyEvent.VK_INSERT)); keys.setKey(97, new Key(KeyEvent.VK_HOME)); keys.setKey(98, new Key(KeyEvent.VK_PAGE_UP)); keys.setKey(99, new Key(KeyEvent.VK_DIVIDE)); keys.setKey(100, new Key(KeyEvent.VK_PRINTSCREEN)); keys.setKey(101, new Key(KeyEvent.VK_DELETE)); keys.setKey(102, new Key(KeyEvent.VK_END)); keys.setKey(103, new Key(KeyEvent.VK_PAGE_DOWN)); keys.setKey(104, new Key(KeyEvent.VK_UP)); keys.setKey(105, new Key(KeyEvent.VK_SEPARATOR)); keys.setKey(110, new Key(KeyEvent.VK_ESCAPE)); keys.setKey(111, new Key(KeyEvent.VK_FINAL)); keys.setKey(112, new Key(KeyEvent.VK_CONTROL)); keys.setKey(113, new Key(KeyEvent.VK_LEFT)); keys.setKey(114, new Key(KeyEvent.VK_DOWN)); keys.setKey(115, new Key(KeyEvent.VK_RIGHT)); keys.setKey(116, new Key(KeyEvent.VK_PAUSE)); }
protected void initKeys(Keys keys) { keys.setKey(1, new Key(KeyEvent.VK_ESCAPE)); keys.setKey(2, new Key('1', KeyEvent.VK_1, '!', KeyEvent.VK_EXCLAMATION_MARK)); keys.setKey(3, new Key('2', KeyEvent.VK_2, '@', KeyEvent.VK_AT)); keys.setKey(4, new Key('3', KeyEvent.VK_3, '#', KeyEvent.VK_NUMBER_SIGN, '', KeyEvent.VK_3)); keys.setKey(5, new Key('4', KeyEvent.VK_4, '$', KeyEvent.VK_DOLLAR)); keys.setKey(6, new Key('5', '%', KeyEvent.VK_5)); keys.setKey(7, new Key('6', '^', KeyEvent.VK_6)); keys.setKey(8, new Key('7', '&', KeyEvent.VK_7)); keys.setKey(9, new Key('8', KeyEvent.VK_8, '*', KeyEvent.VK_MULTIPLY)); keys.setKey(10, new Key('9', KeyEvent.VK_9, '(', KeyEvent.VK_LEFT_PARENTHESIS)); keys.setKey(11, new Key('0', KeyEvent.VK_0, ')', KeyEvent.VK_RIGHT_PARENTHESIS)); keys.setKey(12, new Key('[', KeyEvent.VK_OPEN_BRACKET, '{', KeyEvent.VK_BRACELEFT)); keys.setKey(13, new Key(']', KeyEvent.VK_CLOSE_BRACKET, '}', KeyEvent.VK_BRACERIGHT)); keys.setKey(14, new Key('\b', KeyEvent.VK_BACK_SPACE)); keys.setKey(15, new Key('\t', KeyEvent.VK_TAB)); keys.setKey(16, new Key('\'',KeyEvent.VK_QUOTE, '\"', KeyEvent.VK_QUOTEDBL)); keys.setKey(17, new Key(',',KeyEvent.VK_COMMA, '<', KeyEvent.VK_LESS)); keys.setKey(18, new Key('.',KeyEvent.VK_PERIOD, '>', KeyEvent.VK_GREATER)); keys.setKey(19, new Key('p', 'P', KeyEvent.VK_P)); keys.setKey(20, new Key('y', 'Y', KeyEvent.VK_Y)); keys.setKey(21, new Key('f', 'F', KeyEvent.VK_F)); keys.setKey(22, new Key('g', 'G', KeyEvent.VK_G)); keys.setKey(23, new Key('c', 'C', KeyEvent.VK_C)); keys.setKey(24, new Key('r', 'R', KeyEvent.VK_R)); keys.setKey(25, new Key('l', 'L', KeyEvent.VK_L)); keys.setKey(26, new Key('/', '?',KeyEvent.VK_SLASH)); keys.setKey(27, new Key('=', KeyEvent.VK_EQUALS, '+', KeyEvent.VK_PLUS)); keys.setKey(28, new Key('\n', KeyEvent.VK_ENTER)); keys.setKey(29, new Key((char) 0, KeyEvent.VK_CONTROL)); keys.setKey(30, new Key('a', 'A', KeyEvent.VK_A)); keys.setKey(31, new Key('o', 'O', KeyEvent.VK_O)); keys.setKey(32, new Key('e', 'E', KeyEvent.VK_E)); keys.setKey(33, new Key('u', 'U', KeyEvent.VK_U)); keys.setKey(34, new Key('i', 'I', KeyEvent.VK_I)); keys.setKey(35, new Key('d', 'D', KeyEvent.VK_D)); keys.setKey(36, new Key('h', 'H', KeyEvent.VK_H)); keys.setKey(37, new Key('t', 'T', KeyEvent.VK_T)); keys.setKey(38, new Key('n', 'N', KeyEvent.VK_N)); keys.setKey(39, new Key('s', 'S',KeyEvent.VK_S));//KeyEvent.VK_SEMICOLON, ':', KeyEvent.VK_COLON)); keys.setKey(40, new Key("-".charAt(0), KeyEvent.VK_MINUS, '_', KeyEvent.VK_UNDERSCORE)); keys.setKey(41, new Key('`', '~', KeyEvent.VK_BACK_QUOTE)); keys.setKey(43, new Key('\\', '|', KeyEvent.VK_BACK_SLASH)); keys.setKey(44, new Key(';', KeyEvent.VK_SEMICOLON,':', KeyEvent.VK_COLON)); keys.setKey(45, new Key('q', 'Q', KeyEvent.VK_Q)); keys.setKey(46, new Key('j', 'J', KeyEvent.VK_J)); keys.setKey(47, new Key('k', 'K', KeyEvent.VK_K)); keys.setKey(48, new Key('x', 'X', KeyEvent.VK_X)); keys.setKey(49, new Key('b', 'B', KeyEvent.VK_B)); keys.setKey(50, new Key('m', 'M', KeyEvent.VK_M)); keys.setKey(51, new Key('w', 'M',KeyEvent.VK_M));//KeyEvent.VK_COMMA, '<', KeyEvent.VK_LESS)); keys.setKey(52, new Key('v', 'V',KeyEvent.VK_V));//KeyEvent.VK_PERIOD, '>', KeyEvent.VK_GREATER)); keys.setKey(53, new Key('z', 'Z', KeyEvent.VK_Z)); keys.setKey(55, new Key('*', KeyEvent.VK_MULTIPLY)); keys.setKey(57, new Key(' ', KeyEvent.VK_SPACE)); keys.setKey(71, new Key('7', KeyEvent.VK_NUMPAD7)); keys.setKey(72, new Key('8', KeyEvent.VK_NUMPAD8)); keys.setKey(73, new Key('9', KeyEvent.VK_NUMPAD9)); keys.setKey(74, new Key('-', KeyEvent.VK_SUBTRACT)); keys.setKey(75, new Key('4', KeyEvent.VK_NUMPAD4)); keys.setKey(76, new Key('5', KeyEvent.VK_NUMPAD5)); keys.setKey(77, new Key('6', KeyEvent.VK_NUMPAD6)); keys.setKey(78, new Key('+', KeyEvent.VK_ADD)); keys.setKey(79, new Key('1', KeyEvent.VK_NUMPAD1)); keys.setKey(80, new Key('2', KeyEvent.VK_NUMPAD2)); keys.setKey(81, new Key('3', KeyEvent.VK_NUMPAD3)); keys.setKey(82, new Key('0', KeyEvent.VK_NUMPAD0)); keys.setKey(83, new Key('.', KeyEvent.VK_DECIMAL)); keys.setKey(86, new Key('/', KeyEvent.VK_SLASH)); keys.setKey(42, new Key(KeyEvent.VK_SHIFT)); keys.setKey(54, new Key(KeyEvent.VK_SHIFT)); keys.setKey(56, new Key(KeyEvent.VK_ALT)); keys.setKey(58, new Key(KeyEvent.VK_CAPS_LOCK)); keys.setKey(59, new Key(KeyEvent.VK_F1)); keys.setKey(60, new Key(KeyEvent.VK_F2)); keys.setKey(61, new Key(KeyEvent.VK_F3)); keys.setKey(62, new Key(KeyEvent.VK_F4)); keys.setKey(63, new Key(KeyEvent.VK_F5)); keys.setKey(64, new Key(KeyEvent.VK_F6)); keys.setKey(65, new Key(KeyEvent.VK_F7)); keys.setKey(66, new Key(KeyEvent.VK_F8)); keys.setKey(67, new Key(KeyEvent.VK_F9)); keys.setKey(68, new Key(KeyEvent.VK_F10)); keys.setKey(69, new Key(KeyEvent.VK_NUM_LOCK)); keys.setKey(70, new Key(KeyEvent.VK_SCROLL_LOCK)); keys.setKey(87, new Key(KeyEvent.VK_F11)); keys.setKey(88, new Key(KeyEvent.VK_F12)); keys.setKey(96, new Key(KeyEvent.VK_INSERT)); keys.setKey(97, new Key(KeyEvent.VK_HOME)); keys.setKey(98, new Key(KeyEvent.VK_PAGE_UP)); keys.setKey(99, new Key(KeyEvent.VK_DIVIDE)); keys.setKey(100, new Key(KeyEvent.VK_PRINTSCREEN)); keys.setKey(101, new Key(KeyEvent.VK_DELETE)); keys.setKey(102, new Key(KeyEvent.VK_END)); keys.setKey(103, new Key(KeyEvent.VK_PAGE_DOWN)); keys.setKey(104, new Key(KeyEvent.VK_UP)); keys.setKey(105, new Key(KeyEvent.VK_SEPARATOR)); keys.setKey(110, new Key(KeyEvent.VK_ESCAPE)); keys.setKey(111, new Key(KeyEvent.VK_FINAL)); keys.setKey(112, new Key(KeyEvent.VK_CONTROL)); keys.setKey(113, new Key(KeyEvent.VK_LEFT)); keys.setKey(114, new Key(KeyEvent.VK_DOWN)); keys.setKey(115, new Key(KeyEvent.VK_RIGHT)); keys.setKey(116, new Key(KeyEvent.VK_PAUSE)); }
3,123
private int loadLib(String filename) { SecurityManager sm = securityManager; // Be thread-safe! if (sm != null) sm.checkLink(filename); return VMRuntime.nativeLoad(filename); }
private static int loadLib(String filename) { SecurityManager sm = securityManager; // Be thread-safe! if (sm != null) sm.checkLink(filename); return VMRuntime.nativeLoad(filename); }
3,124
private int loadLib(String filename) { SecurityManager sm = securityManager; // Be thread-safe! if (sm != null) sm.checkLink(filename); return VMRuntime.nativeLoad(filename); }
private int loadLib(String filename) { SecurityManager sm = securityManager; // Be thread-safe! if (sm != null) sm.checkRead(filename); return VMRuntime.nativeLoad(filename); }
3,125
public String getFormat() { return null; }
public String getFormat() { return Registry.RAW_ENCODING_SHORT_NAME; }
3,126
Inet6Address(byte[] addr, String host) { super(addr, host); this.ipaddress = addr; }
Inet6Address(byte[] addr, String host) { super(addr, host); this.ipaddress = addr; }
3,127
public boolean equals(Object obj) { if (! (obj instanceof Inet6Address)) return false; Inet6Address tmp = (Inet6Address) obj; return super.equals(tmp) && this.ipaddress == tmp.ipaddress; }
public boolean equals(Object obj) { if (! (obj instanceof Inet6Address)) return false; Inet6Address tmp = (Inet6Address) obj; return super.equals(tmp) && this.ipaddress == tmp.ipaddress; }
3,128
public byte[] getAddress() { return ipaddress; }
public byte[] getAddress() { return ipaddress; }
3,129
InetAddress(byte[] ipaddr, String hostname) { addr = new byte[ipaddr.length]; for (int i = 0; i < ipaddr.length; i++) addr[i] = ipaddr[i]; this.hostName = hostname; lookup_time = System.currentTimeMillis(); family = 2; /* AF_INET */ }
InetAddress(byte[] ipaddr, String hostname) { addr = (null == ipaddr) ? null : (byte[]) ipaddr.clone(); hostName = hostname; for (int i = 0; i < ipaddr.length; i++) addr[i] = ipaddr[i]; this.hostName = hostname; lookup_time = System.currentTimeMillis(); family = 2; /* AF_INET */ }
3,130
InetAddress(byte[] ipaddr, String hostname) { addr = new byte[ipaddr.length]; for (int i = 0; i < ipaddr.length; i++) addr[i] = ipaddr[i]; this.hostName = hostname; lookup_time = System.currentTimeMillis(); family = 2; /* AF_INET */ }
InetAddress(byte[] ipaddr, String hostname) { addr = new byte[ipaddr.length]; for (int i = 0; i < ipaddr.length; i++) addr[i] = ipaddr[i]; this.hostName = hostname; lookup_time = System.currentTimeMillis(); family = 2; /* AF_INET */ }
3,131
private void storeObject(int offset, Class<?> cls, Object obj, VmClassType<?> vmType) throws BuildException, ClassNotFoundException, JNodeClassNotFoundException { final Class< ? > sCls = cls.getSuperclass(); if (sCls != null) { final VmClassType< ? > vmSuperType = (VmClassType< ? >) loaderContext .loadClass(sCls.getName(), true); storeObject(offset, sCls, obj, vmSuperType); } try { final FieldInfo fieldInfo = getFieldInfo(cls); // final Field fields[] = cls.getDeclaredFields(); final Field[] fields = fieldInfo.getJdkInstanceFields(); final int len = fields.length; // AccessibleObject.setAccessible(fields, true); for (int i = 0; i < len; i++) { final VmField jnodeField = fieldInfo.getJNodeInstanceField(i); final Field jdkField = fields[i]; final int modifiers = jnodeField.getModifiers(); if ((modifiers & Modifier.STATIC) != 0) { throw new BuildException("Static field in instance list"); } final int fldOffset = offset + ((VmInstanceField) jnodeField).getOffset(); if ((jdkField == null) || ((modifiers & Modifier.TRANSIENT) != 0)) { if (jnodeField.isWide()) { os.set64(fldOffset, 0); } else if (!jnodeField.isPrimitive()) { os.setWord(fldOffset, 0); } else { switch (jnodeField.getTypeSize()) { case 1: os.set8(fldOffset, 0); break; case 2: os.set16(fldOffset, 0); break; case 4: os.set32(fldOffset, 0); break; default: throw new BuildException("Invalid typesize in: " + jnodeField); } } if (debugWriter != null) { debugWriter.println(jnodeField.getName() + " transient: 0"); } } else if (jnodeField.isPrimitive()) { final Class< ? > fType = jdkField.getType(); if (debugWriter != null) { debugWriter.println(jdkField.getName() + " " + jdkField.get(obj)); } if (fType == byte.class) { os.set8(fldOffset, jdkField.getByte(obj)); } else if (fType == boolean.class) { os.set8(fldOffset, (jdkField.getBoolean(obj)) ? 1 : 0); } else if (fType == char.class) { os.set16(fldOffset, jdkField.getChar(obj)); } else if (fType == short.class) { os.set16(fldOffset, jdkField.getShort(obj)); } else if (fType == int.class) { os.set32(fldOffset, jdkField.getInt(obj)); } else if (fType == float.class) { os.set32(fldOffset, Float.floatToIntBits(jdkField .getFloat(obj))); } else if (fType == long.class) { os.set64(fldOffset, jdkField.getLong(obj)); } else if (fType == double.class) { os.set64(fldOffset, Double.doubleToLongBits(jdkField .getDouble(obj))); } else { throw new BuildException("Unknown primitive class " + fType.getName()); } } else if (jnodeField.getDeclaringClass().isMagicType()) { final Object value = jdkField.get(obj); if (value == null) { os.writeWord(0); } else if (value instanceof UnboxedObject) { final UnboxedObject uobj = (UnboxedObject)value; os.writeWord(uobj.toLong()); } else { throw new BuildException("Cannot handle magic type " + value.getClass().getName()); } } else { Object value = jdkField.get(obj); try { testForValidEmit(value, cls.getName()); } catch (BuildException ex) { throw new BuildException("Cannot emit field " + jdkField.getName() + " of class " + cls.getName(), ex); } catch (JNodeClassNotFoundException ex) { BootLog .warn("JNode class not found " + ex.getMessage()); value = null; } bis.setObjectRef(fldOffset, value); } } } catch (IllegalAccessException ex) { throw new BuildException("emitting object: [" + obj + "]", ex); } catch (SecurityException ex) { throw new BuildException("emitting object: [" + obj + "]", ex); } }
private void storeObject(int offset, Class<?> cls, Object obj, VmClassType<?> vmType) throws BuildException, ClassNotFoundException, JNodeClassNotFoundException { final Class< ? > sCls = cls.getSuperclass(); if (sCls != null) { final VmClassType< ? > vmSuperType = (VmClassType< ? >) loaderContext .loadClass(sCls.getName(), true); storeObject(offset, sCls, obj, vmSuperType); } try { final FieldInfo fieldInfo = getFieldInfo(cls); // final Field fields[] = cls.getDeclaredFields(); final Field[] fields = fieldInfo.getJdkInstanceFields(); final int len = fields.length; // AccessibleObject.setAccessible(fields, true); for (int i = 0; i < len; i++) { final VmField jnodeField = fieldInfo.getJNodeInstanceField(i); final Field jdkField = fields[i]; final int modifiers = jnodeField.getModifiers(); if ((modifiers & Modifier.STATIC) != 0) { throw new BuildException("Static field in instance list"); } final int fldOffset = offset + ((VmInstanceField) jnodeField).getOffset(); if ((jdkField == null) || ((modifiers & Modifier.TRANSIENT) != 0)) { if (jnodeField.isWide()) { os.set64(fldOffset, 0); } else if (!jnodeField.isPrimitive()) { os.setWord(fldOffset, 0); } else { switch (jnodeField.getTypeSize()) { case 1: os.set8(fldOffset, 0); break; case 2: os.set16(fldOffset, 0); break; case 4: os.set32(fldOffset, 0); break; default: throw new BuildException("Invalid typesize in: " + jnodeField); } } if (debugWriter != null) { debugWriter.println(jnodeField.getName() + " transient: 0"); } } else if (jnodeField.isPrimitive()) { final Class< ? > fType = jdkField.getType(); if (debugWriter != null) { debugWriter.println(jdkField.getName() + " " + jdkField.get(obj)); } if (fType == byte.class) { os.set8(fldOffset, jdkField.getByte(obj)); } else if (fType == boolean.class) { os.set8(fldOffset, (jdkField.getBoolean(obj)) ? 1 : 0); } else if (fType == char.class) { os.set16(fldOffset, jdkField.getChar(obj)); } else if (fType == short.class) { os.set16(fldOffset, jdkField.getShort(obj)); } else if (fType == int.class) { os.set32(fldOffset, jdkField.getInt(obj)); } else if (fType == float.class) { os.set32(fldOffset, Float.floatToIntBits(jdkField .getFloat(obj))); } else if (fType == long.class) { os.set64(fldOffset, jdkField.getLong(obj)); } else if (fType == double.class) { os.set64(fldOffset, Double.doubleToLongBits(jdkField .getDouble(obj))); } else { throw new BuildException("Unknown primitive class " + fType.getName()); } } else if (jnodeField.isAddressType()) { final Object value = jdkField.get(obj); if (value == null) { os.writeWord(0); } else if (value instanceof UnboxedObject) { final UnboxedObject uobj = (UnboxedObject)value; os.writeWord(uobj.toLong()); } else { throw new BuildException("Cannot handle magic type " + value.getClass().getName()); } } else { Object value = jdkField.get(obj); try { testForValidEmit(value, cls.getName()); } catch (BuildException ex) { throw new BuildException("Cannot emit field " + jdkField.getName() + " of class " + cls.getName(), ex); } catch (JNodeClassNotFoundException ex) { BootLog .warn("JNode class not found " + ex.getMessage()); value = null; } bis.setObjectRef(fldOffset, value); } } } catch (IllegalAccessException ex) { throw new BuildException("emitting object: [" + obj + "]", ex); } catch (SecurityException ex) { throw new BuildException("emitting object: [" + obj + "]", ex); } }
3,138
private void storeObject(int offset, Class<?> cls, Object obj, VmClassType<?> vmType) throws BuildException, ClassNotFoundException, JNodeClassNotFoundException { final Class< ? > sCls = cls.getSuperclass(); if (sCls != null) { final VmClassType< ? > vmSuperType = (VmClassType< ? >) loaderContext .loadClass(sCls.getName(), true); storeObject(offset, sCls, obj, vmSuperType); } try { final FieldInfo fieldInfo = getFieldInfo(cls); // final Field fields[] = cls.getDeclaredFields(); final Field[] fields = fieldInfo.getJdkInstanceFields(); final int len = fields.length; // AccessibleObject.setAccessible(fields, true); for (int i = 0; i < len; i++) { final VmField jnodeField = fieldInfo.getJNodeInstanceField(i); final Field jdkField = fields[i]; final int modifiers = jnodeField.getModifiers(); if ((modifiers & Modifier.STATIC) != 0) { throw new BuildException("Static field in instance list"); } final int fldOffset = offset + ((VmInstanceField) jnodeField).getOffset(); if ((jdkField == null) || ((modifiers & Modifier.TRANSIENT) != 0)) { if (jnodeField.isWide()) { os.set64(fldOffset, 0); } else if (!jnodeField.isPrimitive()) { os.setWord(fldOffset, 0); } else { switch (jnodeField.getTypeSize()) { case 1: os.set8(fldOffset, 0); break; case 2: os.set16(fldOffset, 0); break; case 4: os.set32(fldOffset, 0); break; default: throw new BuildException("Invalid typesize in: " + jnodeField); } } if (debugWriter != null) { debugWriter.println(jnodeField.getName() + " transient: 0"); } } else if (jnodeField.isPrimitive()) { final Class< ? > fType = jdkField.getType(); if (debugWriter != null) { debugWriter.println(jdkField.getName() + " " + jdkField.get(obj)); } if (fType == byte.class) { os.set8(fldOffset, jdkField.getByte(obj)); } else if (fType == boolean.class) { os.set8(fldOffset, (jdkField.getBoolean(obj)) ? 1 : 0); } else if (fType == char.class) { os.set16(fldOffset, jdkField.getChar(obj)); } else if (fType == short.class) { os.set16(fldOffset, jdkField.getShort(obj)); } else if (fType == int.class) { os.set32(fldOffset, jdkField.getInt(obj)); } else if (fType == float.class) { os.set32(fldOffset, Float.floatToIntBits(jdkField .getFloat(obj))); } else if (fType == long.class) { os.set64(fldOffset, jdkField.getLong(obj)); } else if (fType == double.class) { os.set64(fldOffset, Double.doubleToLongBits(jdkField .getDouble(obj))); } else { throw new BuildException("Unknown primitive class " + fType.getName()); } } else if (jnodeField.getDeclaringClass().isMagicType()) { final Object value = jdkField.get(obj); if (value == null) { os.writeWord(0); } else if (value instanceof UnboxedObject) { final UnboxedObject uobj = (UnboxedObject)value; os.writeWord(uobj.toLong()); } else { throw new BuildException("Cannot handle magic type " + value.getClass().getName()); } } else { Object value = jdkField.get(obj); try { testForValidEmit(value, cls.getName()); } catch (BuildException ex) { throw new BuildException("Cannot emit field " + jdkField.getName() + " of class " + cls.getName(), ex); } catch (JNodeClassNotFoundException ex) { BootLog .warn("JNode class not found " + ex.getMessage()); value = null; } bis.setObjectRef(fldOffset, value); } } } catch (IllegalAccessException ex) { throw new BuildException("emitting object: [" + obj + "]", ex); } catch (SecurityException ex) { throw new BuildException("emitting object: [" + obj + "]", ex); } }
private void storeObject(int offset, Class<?> cls, Object obj, VmClassType<?> vmType) throws BuildException, ClassNotFoundException, JNodeClassNotFoundException { final Class< ? > sCls = cls.getSuperclass(); if (sCls != null) { final VmClassType< ? > vmSuperType = (VmClassType< ? >) loaderContext .loadClass(sCls.getName(), true); storeObject(offset, sCls, obj, vmSuperType); } try { final FieldInfo fieldInfo = getFieldInfo(cls); // final Field fields[] = cls.getDeclaredFields(); final Field[] fields = fieldInfo.getJdkInstanceFields(); final int len = fields.length; // AccessibleObject.setAccessible(fields, true); for (int i = 0; i < len; i++) { final VmField jnodeField = fieldInfo.getJNodeInstanceField(i); final Field jdkField = fields[i]; final int modifiers = jnodeField.getModifiers(); if ((modifiers & Modifier.STATIC) != 0) { throw new BuildException("Static field in instance list"); } final int fldOffset = offset + ((VmInstanceField) jnodeField).getOffset(); if ((jdkField == null) || ((modifiers & Modifier.TRANSIENT) != 0)) { if (jnodeField.isWide()) { os.set64(fldOffset, 0); } else if (!jnodeField.isPrimitive()) { os.setWord(fldOffset, 0); } else { switch (jnodeField.getTypeSize()) { case 1: os.set8(fldOffset, 0); break; case 2: os.set16(fldOffset, 0); break; case 4: os.set32(fldOffset, 0); break; default: throw new BuildException("Invalid typesize in: " + jnodeField); } } if (debugWriter != null) { debugWriter.println(jnodeField.getName() + " transient: 0"); } } else if (jnodeField.isPrimitive()) { final Class< ? > fType = jdkField.getType(); if (debugWriter != null) { debugWriter.println(jdkField.getName() + " " + jdkField.get(obj)); } if (fType == byte.class) { os.set8(fldOffset, jdkField.getByte(obj)); } else if (fType == boolean.class) { os.set8(fldOffset, (jdkField.getBoolean(obj)) ? 1 : 0); } else if (fType == char.class) { os.set16(fldOffset, jdkField.getChar(obj)); } else if (fType == short.class) { os.set16(fldOffset, jdkField.getShort(obj)); } else if (fType == int.class) { os.set32(fldOffset, jdkField.getInt(obj)); } else if (fType == float.class) { os.set32(fldOffset, Float.floatToIntBits(jdkField .getFloat(obj))); } else if (fType == long.class) { os.set64(fldOffset, jdkField.getLong(obj)); } else if (fType == double.class) { os.set64(fldOffset, Double.doubleToLongBits(jdkField .getDouble(obj))); } else { throw new BuildException("Unknown primitive class " + fType.getName()); } } else if (jnodeField.getDeclaringClass().isMagicType()) { final Object value = jdkField.get(obj); if (value == null) { os.setWord(fldOffset, 0); } else if (value instanceof UnboxedObject) { final UnboxedObject uobj = (UnboxedObject)value; os.writeWord(uobj.toLong()); } else { throw new BuildException("Cannot handle magic type " + value.getClass().getName()); } } else { Object value = jdkField.get(obj); try { testForValidEmit(value, cls.getName()); } catch (BuildException ex) { throw new BuildException("Cannot emit field " + jdkField.getName() + " of class " + cls.getName(), ex); } catch (JNodeClassNotFoundException ex) { BootLog .warn("JNode class not found " + ex.getMessage()); value = null; } bis.setObjectRef(fldOffset, value); } } } catch (IllegalAccessException ex) { throw new BuildException("emitting object: [" + obj + "]", ex); } catch (SecurityException ex) { throw new BuildException("emitting object: [" + obj + "]", ex); } }
3,139
private void storeObject(int offset, Class<?> cls, Object obj, VmClassType<?> vmType) throws BuildException, ClassNotFoundException, JNodeClassNotFoundException { final Class< ? > sCls = cls.getSuperclass(); if (sCls != null) { final VmClassType< ? > vmSuperType = (VmClassType< ? >) loaderContext .loadClass(sCls.getName(), true); storeObject(offset, sCls, obj, vmSuperType); } try { final FieldInfo fieldInfo = getFieldInfo(cls); // final Field fields[] = cls.getDeclaredFields(); final Field[] fields = fieldInfo.getJdkInstanceFields(); final int len = fields.length; // AccessibleObject.setAccessible(fields, true); for (int i = 0; i < len; i++) { final VmField jnodeField = fieldInfo.getJNodeInstanceField(i); final Field jdkField = fields[i]; final int modifiers = jnodeField.getModifiers(); if ((modifiers & Modifier.STATIC) != 0) { throw new BuildException("Static field in instance list"); } final int fldOffset = offset + ((VmInstanceField) jnodeField).getOffset(); if ((jdkField == null) || ((modifiers & Modifier.TRANSIENT) != 0)) { if (jnodeField.isWide()) { os.set64(fldOffset, 0); } else if (!jnodeField.isPrimitive()) { os.setWord(fldOffset, 0); } else { switch (jnodeField.getTypeSize()) { case 1: os.set8(fldOffset, 0); break; case 2: os.set16(fldOffset, 0); break; case 4: os.set32(fldOffset, 0); break; default: throw new BuildException("Invalid typesize in: " + jnodeField); } } if (debugWriter != null) { debugWriter.println(jnodeField.getName() + " transient: 0"); } } else if (jnodeField.isPrimitive()) { final Class< ? > fType = jdkField.getType(); if (debugWriter != null) { debugWriter.println(jdkField.getName() + " " + jdkField.get(obj)); } if (fType == byte.class) { os.set8(fldOffset, jdkField.getByte(obj)); } else if (fType == boolean.class) { os.set8(fldOffset, (jdkField.getBoolean(obj)) ? 1 : 0); } else if (fType == char.class) { os.set16(fldOffset, jdkField.getChar(obj)); } else if (fType == short.class) { os.set16(fldOffset, jdkField.getShort(obj)); } else if (fType == int.class) { os.set32(fldOffset, jdkField.getInt(obj)); } else if (fType == float.class) { os.set32(fldOffset, Float.floatToIntBits(jdkField .getFloat(obj))); } else if (fType == long.class) { os.set64(fldOffset, jdkField.getLong(obj)); } else if (fType == double.class) { os.set64(fldOffset, Double.doubleToLongBits(jdkField .getDouble(obj))); } else { throw new BuildException("Unknown primitive class " + fType.getName()); } } else if (jnodeField.getDeclaringClass().isMagicType()) { final Object value = jdkField.get(obj); if (value == null) { os.writeWord(0); } else if (value instanceof UnboxedObject) { final UnboxedObject uobj = (UnboxedObject)value; os.writeWord(uobj.toLong()); } else { throw new BuildException("Cannot handle magic type " + value.getClass().getName()); } } else { Object value = jdkField.get(obj); try { testForValidEmit(value, cls.getName()); } catch (BuildException ex) { throw new BuildException("Cannot emit field " + jdkField.getName() + " of class " + cls.getName(), ex); } catch (JNodeClassNotFoundException ex) { BootLog .warn("JNode class not found " + ex.getMessage()); value = null; } bis.setObjectRef(fldOffset, value); } } } catch (IllegalAccessException ex) { throw new BuildException("emitting object: [" + obj + "]", ex); } catch (SecurityException ex) { throw new BuildException("emitting object: [" + obj + "]", ex); } }
private void storeObject(int offset, Class<?> cls, Object obj, VmClassType<?> vmType) throws BuildException, ClassNotFoundException, JNodeClassNotFoundException { final Class< ? > sCls = cls.getSuperclass(); if (sCls != null) { final VmClassType< ? > vmSuperType = (VmClassType< ? >) loaderContext .loadClass(sCls.getName(), true); storeObject(offset, sCls, obj, vmSuperType); } try { final FieldInfo fieldInfo = getFieldInfo(cls); // final Field fields[] = cls.getDeclaredFields(); final Field[] fields = fieldInfo.getJdkInstanceFields(); final int len = fields.length; // AccessibleObject.setAccessible(fields, true); for (int i = 0; i < len; i++) { final VmField jnodeField = fieldInfo.getJNodeInstanceField(i); final Field jdkField = fields[i]; final int modifiers = jnodeField.getModifiers(); if ((modifiers & Modifier.STATIC) != 0) { throw new BuildException("Static field in instance list"); } final int fldOffset = offset + ((VmInstanceField) jnodeField).getOffset(); if ((jdkField == null) || ((modifiers & Modifier.TRANSIENT) != 0)) { if (jnodeField.isWide()) { os.set64(fldOffset, 0); } else if (!jnodeField.isPrimitive()) { os.setWord(fldOffset, 0); } else { switch (jnodeField.getTypeSize()) { case 1: os.set8(fldOffset, 0); break; case 2: os.set16(fldOffset, 0); break; case 4: os.set32(fldOffset, 0); break; default: throw new BuildException("Invalid typesize in: " + jnodeField); } } if (debugWriter != null) { debugWriter.println(jnodeField.getName() + " transient: 0"); } } else if (jnodeField.isPrimitive()) { final Class< ? > fType = jdkField.getType(); if (debugWriter != null) { debugWriter.println(jdkField.getName() + " " + jdkField.get(obj)); } if (fType == byte.class) { os.set8(fldOffset, jdkField.getByte(obj)); } else if (fType == boolean.class) { os.set8(fldOffset, (jdkField.getBoolean(obj)) ? 1 : 0); } else if (fType == char.class) { os.set16(fldOffset, jdkField.getChar(obj)); } else if (fType == short.class) { os.set16(fldOffset, jdkField.getShort(obj)); } else if (fType == int.class) { os.set32(fldOffset, jdkField.getInt(obj)); } else if (fType == float.class) { os.set32(fldOffset, Float.floatToIntBits(jdkField .getFloat(obj))); } else if (fType == long.class) { os.set64(fldOffset, jdkField.getLong(obj)); } else if (fType == double.class) { os.set64(fldOffset, Double.doubleToLongBits(jdkField .getDouble(obj))); } else { throw new BuildException("Unknown primitive class " + fType.getName()); } } else if (jnodeField.getDeclaringClass().isMagicType()) { final Object value = jdkField.get(obj); if (value == null) { os.writeWord(0); } else if (value instanceof UnboxedObject) { final UnboxedObject uobj = (UnboxedObject)value; os.setWord(fldOffset, uobj.toLong()); } else if (value instanceof Label) { final Label lbl = (Label)value; bis.setObjectRef(fldOffset, lbl); } else { throw new BuildException("Cannot handle magic type " + value.getClass().getName()); } } else { Object value = jdkField.get(obj); try { testForValidEmit(value, cls.getName()); } catch (BuildException ex) { throw new BuildException("Cannot emit field " + jdkField.getName() + " of class " + cls.getName(), ex); } catch (JNodeClassNotFoundException ex) { BootLog .warn("JNode class not found " + ex.getMessage()); value = null; } bis.setObjectRef(fldOffset, value); } } } catch (IllegalAccessException ex) { throw new BuildException("emitting object: [" + obj + "]", ex); } catch (SecurityException ex) { throw new BuildException("emitting object: [" + obj + "]", ex); } }
3,140
private void jbInit() throws Exception { this.setSize(new Dimension(400,300)); Properties sesProps = new Properties(); // Start loading properties - Host must exist sesProps.put(SESSION_HOST,getParameter("host")); if (isSpecified("-e")) sesProps.put(SESSION_TN_ENHANCED,"1"); if (isSpecified("-p")) { sesProps.put(SESSION_HOST_PORT,getParameter("-p")); }// if (isSpecified("-f",args))// propFileName = getParm("-f",args); if (isSpecified("-cp")) sesProps.put(SESSION_CODE_PAGE ,getParameter("-cp")); if (isSpecified("-gui")) sesProps.put(SESSION_USE_GUI,"1"); if (isSpecified("-132")) sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR); else sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR); // socks proxy host argument if (isSpecified("-sph")) { sesProps.put(SESSION_PROXY_HOST ,getParameter("-sph")); } // socks proxy port argument if (isSpecified("-spp")) sesProps.put(SESSION_PROXY_PORT ,getParameter("-spp")); // check if device name is specified if (isSpecified("-dn")) sesProps.put(SESSION_DEVICE_NAME ,getParameter("-dn")); if (isSpecified("-L")) LangTool.init(parseLocale(getParameter("-L"))); else LangTool.init(); manager = new SessionManager(); Session s = manager.openSession(sesProps,"","Test Applet"); this.getContentPane().add(s); s.grabFocus(); s.connect(); }
private void jbInit() throws Exception { this.setSize(new Dimension(400,300)); Properties sesProps = new Properties(); // Start loading properties - Host must exist sesProps.put(SESSION_HOST,getParameter("host")); if (isSpecified("-e")) sesProps.put(SESSION_TN_ENHANCED,"1"); if (isSpecified("-p")) { sesProps.put(SESSION_HOST_PORT,getParameter("-p")); }// if (isSpecified("-f",args))// propFileName = getParm("-f",args); if (isSpecified("-cp")) sesProps.put(SESSION_CODE_PAGE ,getParameter("-cp")); if (isSpecified("-gui")) sesProps.put(SESSION_USE_GUI,"1"); if (isSpecified("-132")) sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR); else sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR); // socks proxy host argument if (isSpecified("-sph")) { sesProps.put(SESSION_PROXY_HOST ,getParameter("-sph")); } // socks proxy port argument if (isSpecified("-spp")) sesProps.put(SESSION_PROXY_PORT ,getParameter("-spp")); // check if device name is specified if (isSpecified("-dn")) sesProps.put(SESSION_DEVICE_NAME ,getParameter("-dn")); if (isSpecified("-L")) LangTool.init(parseLocale(getParameter("-L"))); else LangTool.init(); manager = new SessionManager(); Session s = manager.openSession(sesProps,"","Test Applet"); this.getContentPane().add(s); s.connect(); }
3,141
public Dimension getPreferredSize() { return getLayout().preferredLayoutSize(this); }
public Dimension getPreferredSize() { return getLayout().preferredLayoutSize(this); }
3,142
public void layoutContainer(Container c) { Dimension size = c.getSize(); Insets insets = c.getInsets(); int width = size.width - insets.left - insets.right; int height = size.height - insets.top - insets.bottom; // MenuBar is always present and located at the top left corner. Dimension menupref = menuBar.getPreferredSize(); menuBar.setBounds(insets.left, insets.top, menupref.width, height); int loc = width + insets.left - 1; int top = insets.top + 1; int buttonWidth = height - 2; int buttonHeight = height - 4; if (closeButton.isVisible()) { loc -= buttonWidth + 2; closeButton.setBounds(loc, top, buttonWidth, buttonHeight); } if (maxButton.isVisible()) { loc -= buttonWidth + 2; maxButton.setBounds(loc, top, buttonWidth, buttonHeight); } if (iconButton.isVisible()) { loc -= buttonWidth + 2; iconButton.setBounds(loc, top, buttonWidth, buttonHeight); } if (title != null) title.setBounds(insets.left + menupref.width, insets.top, loc - menupref.width - insets.left, height); }
public void layoutContainer(Container c) { Dimension size = c.getSize(); Insets insets = c.getInsets(); int width = size.width - insets.left - insets.right; int height = size.height - insets.top - insets.bottom; // MenuBar is always present and located at the top left corner. Dimension menupref = menuBar.getPreferredSize(); menuBar.setBounds(insets.left, insets.top, menupref.width, height); int loc = width + insets.left - 1; int top = insets.top + 1; int buttonHeight = height - 4; if (closeButton.isVisible()) { loc -= buttonWidth + 2; closeButton.setBounds(loc, top, buttonWidth, buttonHeight); } if (maxButton.isVisible()) { loc -= buttonWidth + 2; maxButton.setBounds(loc, top, buttonWidth, buttonHeight); } if (iconButton.isVisible()) { loc -= buttonWidth + 2; iconButton.setBounds(loc, top, buttonWidth, buttonHeight); } if (title != null) title.setBounds(insets.left + menupref.width, insets.top, loc - menupref.width - insets.left, height); }
3,143
public void layoutContainer(Container c) { Dimension size = c.getSize(); Insets insets = c.getInsets(); int width = size.width - insets.left - insets.right; int height = size.height - insets.top - insets.bottom; // MenuBar is always present and located at the top left corner. Dimension menupref = menuBar.getPreferredSize(); menuBar.setBounds(insets.left, insets.top, menupref.width, height); int loc = width + insets.left - 1; int top = insets.top + 1; int buttonWidth = height - 2; int buttonHeight = height - 4; if (closeButton.isVisible()) { loc -= buttonWidth + 2; closeButton.setBounds(loc, top, buttonWidth, buttonHeight); } if (maxButton.isVisible()) { loc -= buttonWidth + 2; maxButton.setBounds(loc, top, buttonWidth, buttonHeight); } if (iconButton.isVisible()) { loc -= buttonWidth + 2; iconButton.setBounds(loc, top, buttonWidth, buttonHeight); } if (title != null) title.setBounds(insets.left + menupref.width, insets.top, loc - menupref.width - insets.left, height); }
public void layoutContainer(Container c) { Dimension size = c.getSize(); Insets insets = c.getInsets(); int width = size.width - insets.left - insets.right; int height = size.height - insets.top - insets.bottom; // MenuBar is always present and located at the top left corner. Dimension menupref = menuBar.getPreferredSize(); menuBar.setBounds(insets.left, insets.top, menupref.width, height); int loc = width + insets.left - 1; int top = insets.top + 1; int buttonWidth = height - 2; int buttonHeight = height - 4; if (closeButton.isVisible()) { loc -= buttonWidth + 2; closeButton.setBounds(loc, top, buttonWidth, buttonHeight); } if (maxButton.isVisible()) { loc -= buttonWidth + 2; maxButton.setBounds(loc, top, buttonWidth, buttonHeight); } if (iconButton.isVisible()) { loc -= buttonWidth + 2; iconButton.setBounds(loc, top, buttonWidth, buttonHeight); } if (title != null) title.setBounds(insets.left + menupref.width, insets.top, loc - menupref.width - insets.left, height); }
3,144
public void layoutContainer(Container c) { Dimension size = c.getSize(); Insets insets = c.getInsets(); int width = size.width - insets.left - insets.right; int height = size.height - insets.top - insets.bottom; // MenuBar is always present and located at the top left corner. Dimension menupref = menuBar.getPreferredSize(); menuBar.setBounds(insets.left, insets.top, menupref.width, height); int loc = width + insets.left - 1; int top = insets.top + 1; int buttonWidth = height - 2; int buttonHeight = height - 4; if (closeButton.isVisible()) { loc -= buttonWidth + 2; closeButton.setBounds(loc, top, buttonWidth, buttonHeight); } if (maxButton.isVisible()) { loc -= buttonWidth + 2; maxButton.setBounds(loc, top, buttonWidth, buttonHeight); } if (iconButton.isVisible()) { loc -= buttonWidth + 2; iconButton.setBounds(loc, top, buttonWidth, buttonHeight); } if (title != null) title.setBounds(insets.left + menupref.width, insets.top, loc - menupref.width - insets.left, height); }
public void layoutContainer(Container c) { Dimension size = c.getSize(); Insets insets = c.getInsets(); int width = size.width - insets.left - insets.right; int height = size.height - insets.top - insets.bottom; // MenuBar is always present and located at the top left corner. Dimension menupref = menuBar.getPreferredSize(); menuBar.setBounds(insets.left, insets.top, menupref.width, height); int loc = width + insets.left - 1; int top = insets.top + 1; int buttonWidth = height - 2; int buttonHeight = height - 4; if (closeButton.isVisible()) { loc -= buttonWidth + 2; closeButton.setBounds(loc, top, buttonWidth, buttonHeight); } if (maxButton.isVisible()) { loc -= buttonWidth + 2; maxButton.setBounds(loc, top, buttonWidth, buttonHeight); } if (iconButton.isVisible()) { loc -= buttonWidth + 2; iconButton.setBounds(loc, top, buttonWidth, buttonHeight); } if (title != null) title.setBounds(insets.left + menupref.width, insets.top, loc - menupref.width - insets.left, height); }
3,145
public void layoutContainer(Container c) { Dimension size = c.getSize(); Insets insets = c.getInsets(); int width = size.width - insets.left - insets.right; int height = size.height - insets.top - insets.bottom; // MenuBar is always present and located at the top left corner. Dimension menupref = menuBar.getPreferredSize(); menuBar.setBounds(insets.left, insets.top, menupref.width, height); int loc = width + insets.left - 1; int top = insets.top + 1; int buttonWidth = height - 2; int buttonHeight = height - 4; if (closeButton.isVisible()) { loc -= buttonWidth + 2; closeButton.setBounds(loc, top, buttonWidth, buttonHeight); } if (maxButton.isVisible()) { loc -= buttonWidth + 2; maxButton.setBounds(loc, top, buttonWidth, buttonHeight); } if (iconButton.isVisible()) { loc -= buttonWidth + 2; iconButton.setBounds(loc, top, buttonWidth, buttonHeight); } if (title != null) title.setBounds(insets.left + menupref.width, insets.top, loc - menupref.width - insets.left, height); }
public void layoutContainer(Container c) { Dimension size = c.getSize(); Insets insets = c.getInsets(); int width = size.width - insets.left - insets.right; int height = size.height - insets.top - insets.bottom; // MenuBar is always present and located at the top left corner. Dimension menupref = menuBar.getPreferredSize(); menuBar.setBounds(insets.left, insets.top, menupref.width, height); int loc = width + insets.left - 1; int top = insets.top + 1; int buttonWidth = height - 2; int buttonHeight = height - 4; if (closeButton.isVisible()) { loc -= buttonWidth + 2; closeButton.setBounds(loc, top, buttonWidth, buttonHeight); } if (maxButton.isVisible()) { loc -= buttonWidth + 2; maxButton.setBounds(loc, top, buttonWidth, buttonHeight); } if (iconButton.isVisible()) { loc -= buttonWidth + 2; iconButton.setBounds(loc, top, buttonWidth, buttonHeight); } if (title != null) title.setBounds(insets.left + menupref.width, insets.top, loc - menupref.width - insets.left, height); }
3,146
protected void installDefaults() { // FIXME: move icons to defaults. UIDefaults defaults = UIManager.getLookAndFeelDefaults(); setFont(defaults.getFont("InternalFrame.titleFont")); selectedTextColor = defaults.getColor("InternalFrame.activeTitleForeground"); selectedTitleColor = defaults.getColor("InternalFrame.activeTitleBackground"); notSelectedTextColor = defaults.getColor("InternalFrame.inactiveTitleForeground"); notSelectedTitleColor = defaults.getColor("InternalFrame.inactiveTitleBackground"); }
protectedvoidinstallDefaults(){//FIXME:moveiconstodefaults.UIDefaultsdefaults=UIManager.getLookAndFeelDefaults();setFont(defaults.getFont("InternalFrame.titleFont"));selectedTextColor=defaults.getColor("InternalFrame.activeTitleForeground");selectedTitleColor=defaults.getColor("InternalFrame.activeTitleBackground");notSelectedTextColor=defaults.getColor("InternalFrame.inactiveTitleForeground");notSelectedTitleColor=defaults.getColor("InternalFrame.inactiveTitleBackground");}
3,148
protected void installDefaults() { // FIXME: move icons to defaults. UIDefaults defaults = UIManager.getLookAndFeelDefaults(); setFont(defaults.getFont("InternalFrame.titleFont")); selectedTextColor = defaults.getColor("InternalFrame.activeTitleForeground"); selectedTitleColor = defaults.getColor("InternalFrame.activeTitleBackground"); notSelectedTextColor = defaults.getColor("InternalFrame.inactiveTitleForeground"); notSelectedTitleColor = defaults.getColor("InternalFrame.inactiveTitleBackground"); }
protected void installDefaults() { // FIXME: move icons to defaults. UIDefaults defaults = UIManager.getLookAndFeelDefaults(); title.setFont(defaults.getFont("InternalFrame.titleFont")); selectedTextColor = defaults.getColor("InternalFrame.activeTitleForeground"); selectedTitleColor = defaults.getColor("InternalFrame.activeTitleBackground"); notSelectedTextColor = defaults.getColor("InternalFrame.inactiveTitleForeground"); notSelectedTitleColor = defaults.getColor("InternalFrame.inactiveTitleBackground"); }
3,149
protected void installListeners() { propertyChangeListener = new PropertyChangeHandler(); frame.addPropertyChangeListener(propertyChangeListener); }
protected void installListeners() { propertyChangeListener = createPropertyChangeListener(); frame.addPropertyChangeListener(propertyChangeListener); }
3,151
public void paintComponent(Graphics g) { paintTitleBackground(g); Font f = g.getFont(); FontMetrics fm = g.getFontMetrics(f); if (frame.getTitle() != null && title != null) { Color saved = g.getColor(); if (frame.isSelected()) g.setColor(selectedTextColor); else g.setColor(notSelectedTextColor); title.setText(getTitle(frame.getTitle(), fm, title.getBounds().width)); SwingUtilities.paintComponent(g, title, null, title.getBounds()); g.setColor(saved); } }
public void paintComponent(Graphics g) { paintTitleBackground(g); Font f = g.getFont(); FontMetrics fm = g.getFontMetrics(f); if (frame.getTitle() != null && title != null) { Color saved = g.getColor(); if (frame.isSelected()) g.setColor(selectedTextColor); else g.setColor(notSelectedTextColor); title.setText(getTitle(frame.getTitle(), fm, title.getBounds().width)); SwingUtilities.paintComponent(g, title, null, title.getBounds()); g.setColor(saved); } }
3,152
protected void setButtonIcons() { Icon icon = UIManager.getIcon("InternalFrame.closeIcon"); if (icon != null) closeButton.setIcon(icon); icon = UIManager.getIcon("InternalFrame.iconifyIcon"); if (icon != null) iconButton.setIcon(icon); icon = UIManager.getIcon("InternalFrame.maximizeIcon"); if (icon != null) maxButton.setIcon(icon); }
protected void setButtonIcons() { Icon icon = UIManager.getIcon("InternalFrame.closeIcon"); if (icon != null) closeButton.setIcon(icon); icon = UIManager.getIcon("InternalFrame.iconifyIcon"); if (icon != null) iconButton.setIcon(icon); icon = UIManager.getIcon("InternalFrame.maximizeIcon"); if (icon != null) maxButton.setIcon(icon); }
3,154
protected void installListeners() { // install combo box's listeners propertyChangeListener = createPropertyChangeListener(); comboBox.addPropertyChangeListener(propertyChangeListener); focusListener = createFocusListener(); comboBox.addFocusListener(focusListener); listBox.addFocusListener(focusListener); itemListener = createItemListener(); comboBox.addItemListener(itemListener); keyListener = createKeyListener(); comboBox.addKeyListener(keyListener); mouseListener = createMouseListener(); arrowButton.addMouseListener(mouseListener); // install listeners that listen to combo box model listDataListener = createListDataListener(); comboBox.getModel().addListDataListener(listDataListener); }
protected void installListeners() { // install combo box's listeners propertyChangeListener = createPropertyChangeListener(); comboBox.addPropertyChangeListener(propertyChangeListener); focusListener = createFocusListener(); comboBox.addFocusListener(focusListener); listBox.addFocusListener(focusListener); itemListener = createItemListener(); comboBox.addItemListener(itemListener); keyListener = createKeyListener(); comboBox.addKeyListener(keyListener); mouseListener = createMouseListener(); arrowButton.addMouseListener(mouseListener); // install listeners that listen to combo box model listDataListener = createListDataListener(); comboBox.getModel().addListDataListener(listDataListener); }
3,157
public void setPopupVisible(JComboBox c, boolean v) { if (v) { popup.show(); popup.getList().requestFocus(); } else popup.hide(); }
public void setPopupVisible(JComboBox c, boolean v) if (v) popup.show(); popup.getList().requestFocus(); } else popup.hide(); }
3,158
public void setPopupVisible(JComboBox c, boolean v) { if (v) { popup.show(); popup.getList().requestFocus(); } else popup.hide(); }
public void setPopupVisible(JComboBox c, boolean v) { if (v) { popup.show(); popup.getList().requestFocus(); } else popup.hide(); }
3,159
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { if (value != null) { if (value instanceof JTextField) return new JTextField(((JTextField)value).getText()); super.setText(value.toString()); } else // null is rendered as an empty cell. super.setText(""); setOpaque(true); if (table == null) return this; if (isSelected) { super.setBackground(table.getSelectionBackground()); super.setForeground(table.getSelectionForeground()); } else { if (background != null) super.setBackground(background); else super.setBackground(table.getBackground()); if (foreground != null) super.setForeground(foreground); else super.setForeground(table.getForeground()); } if (hasFocus) { setBorder(UIManager.getBorder("Table.focusCellHighlightBorder")); if (table.isCellEditable(row, column)) { super.setBackground(UIManager.getColor("Table.focusCellBackground")); super.setForeground(UIManager.getColor("Table.focusCellForeground")); } } else setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1)); setFont(table.getFont()); // If the current background is equal to the table's background, then we // can avoid filling the background by setting the renderer opaque. Color back = getBackground(); setOpaque(back != null && back.equals(table.getBackground())); return this; }
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { if (value != null) { if (value instanceof JTextField) return new JTextField(((JTextField)value).getText()); super.setText(value.toString()); } else // null is rendered as an empty cell. super.setText(""); setOpaque(true); if (table == null) return this; if (isSelected) { super.setBackground(table.getSelectionBackground()); super.setForeground(table.getSelectionForeground()); } else { if (background != null) super.setBackground(background); else super.setBackground(table.getBackground()); if (foreground != null) super.setForeground(foreground); else super.setForeground(table.getForeground()); } if (hasFocus) { setBorder(UIManager.getBorder("Table.focusCellHighlightBorder")); if (table.isCellEditable(row, column)) { super.setBackground(UIManager.getColor("Table.focusCellBackground")); super.setForeground(UIManager.getColor("Table.focusCellForeground")); } } else setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1)); setFont(table.getFont()); // If the current background is equal to the table's background, then we // can avoid filling the background by setting the renderer opaque. Color back = getBackground(); setOpaque(back != null && back.equals(table.getBackground())); return this; }
3,162
protected void setValue(Object value) { super.setText((value!=null) ? value.toString() : ""); }
protected void setValue(Object value) { if (value != null) setText(value.toString()); else setText(""); }
3,163
public InstantiationException() { super(); }
public InstantiationException() { super(); }
3,164
public SwingPanelPeer(Panel panel) { super(); SwingToolkit.add(panel, this); SwingToolkit.copyAwtProperties(panel, this); setLayout(null); }
public SwingPanelPeer(Panel panel) { super(); SwingToolkit.add(panel, this); SwingToolkit.copyAwtProperties(panel, this); setLayout(null); }
3,165
public final boolean requestFocus(Component lightweightChild, boolean temporary, boolean focusedWindowChangeAllowed, long time) { return true; }
public final boolean requestFocus(Component lightweightChild, boolean temporary, boolean focusedWindowChangeAllowed, long time) { return true; }
3,166
public SwingMenuPeer(SwingToolkit toolkit, Menu menu, JComponent jComponent) { super(toolkit, menu, jComponent); }
public SwingMenuPeer(SwingToolkit toolkit, Menu menu, JComponent jComponent) { super(toolkit, menu, jComponent); }
3,167