Package net.sourceforge.marathon.util.PropertyList

Examples of net.sourceforge.marathon.util.PropertyList.Property


        @Override
        public TableCellRenderer getCellRenderer(int row, int column) {
            if (column == 0)
                return super.getCellRenderer(row, column);
            PropertyTableModel model = (PropertyTableModel) getModel();
            Property property = model.getProperty(row);
            if (property.getKlass().equals(Color.class))
                return new ColorRenderer(false);
            if (property.getKlass().equals(Font.class))
                return new FontRenderer();
            return super.getCellRenderer(row, column);
        }
View Full Code Here


        @Override
        public TableCellEditor getCellEditor(int row, int column) {
            if (column == 0)
                return super.getCellEditor(row, column);
            PropertyTableModel model = (PropertyTableModel) getModel();
            Property property = model.getProperty(row);
            if (property.getKlass().equals(Color.class))
                return new ColorEditor();
            if (property.getKlass().equals(Font.class)) {
                JComboBox box = new JComboBox(GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames());
                return new DefaultCellEditor(box);
            }
            if (property.getKlass().equals(Boolean.class)) {
                JComboBox box = new JComboBox(new String[] { "true", "false" });
                return new DefaultCellEditor(box);
            }
            if (property.getKlass().equals(String[].class)) {
                JComboBox box = new JComboBox(property.getItems());
                return new DefaultCellEditor(box);
            }
            if (property.getKlass().equals(Integer.class))
                return new IntegerEditor(0, Integer.MAX_VALUE);
            return super.getCellEditor(row, column);
        }
View Full Code Here

            else
                return "Value";
        }

        public Object getValueAt(int rowIndex, int columnIndex) {
            Property property = propList.getProperty(rowIndex);
            if (columnIndex == 0)
                return property.getDescription();
            else
                return property.getValue();
        }
View Full Code Here

            return columnIndex != 0;
        }

        @Override
        public void setValueAt(Object value, int rowIndex, int columnIndex) {
            Property property = propList.getProperty(rowIndex);
            if (columnIndex == 0)
                return;
            else
                property.setValue(value.toString());
        }
View Full Code Here

TOP

Related Classes of net.sourceforge.marathon.util.PropertyList.Property

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.