Package org.apache.jorphan.gui

Examples of org.apache.jorphan.gui.ObjectTableModel


        if (!(hdrs instanceof String[])){
            throw new RuntimeException("attribute HEADERS must be a String array");           
        }
        if(clazz == String.class)
        {
            model = new ObjectTableModel((String[])hdrs,new Functor[0],new Functor[0],new Class[]{String.class});
        }
        else
        {
            Object value = descriptor.getValue(OBJECT_PROPERTIES);
            if (!(value instanceof String[])) {
                throw new RuntimeException("attribute OBJECT_PROPERTIES must be a String array");
            }
            String[] props = (String[])value;
            Functor[] writers = new Functor[props.length];
            Functor[] readers = new Functor[props.length];
            Class<?>[] editors = new Class[props.length];
            int count = 0;
            for(String propName : props)
            {
                propName = propName.substring(0,1).toUpperCase(Locale.ENGLISH) + propName.substring(1);
                writers[count] = createWriter(clazz,propName);
                readers[count] = createReader(clazz,propName);
                editors[count] = getArgForWriter(clazz,propName);
                count++;
            }
            model = new ObjectTableModel((String[])hdrs,readers,writers,editors);
        }
        model.addTableModelListener(this);
        table = new JTable(model);
        table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        table.addFocusListener(this);
View Full Code Here


    /**
     * Constructor for the TableVisualizer object.
     */
    public TableVisualizer() {
        super();
        model = new ObjectTableModel(COLUMNS,
                TableSample.class,         // The object used for each row
                new Functor[] {
                new Functor("getSampleNumberString"), // $NON-NLS-1$
                new Functor("getStartTimeFormatted"// $NON-NLS-1$
                        new Object[]{format}),
View Full Code Here

    /**
     * Initialize the table model used for the arguments table.
     */
    protected void initializeTableModel() {
        if(standalone) {
            tableModel = new ObjectTableModel(new String[] { COLUMN_RESOURCE_NAMES_0, COLUMN_RESOURCE_NAMES_1, COLUMN_RESOURCE_NAMES_2 },
                    Argument.class,
                    new Functor[] {
                    new Functor("getName"), // $NON-NLS-1$
                    new Functor("getValue")// $NON-NLS-1$
                    new Functor("getDescription") }// $NON-NLS-1$
                    new Functor[] {
                    new Functor("setName"), // $NON-NLS-1$
                    new Functor("setValue"), // $NON-NLS-1$
                    new Functor("setDescription") }// $NON-NLS-1$
                    new Class[] { String.class, String.class, String.class });
        } else {
        tableModel = new ObjectTableModel(new String[] { COLUMN_RESOURCE_NAMES_0, COLUMN_RESOURCE_NAMES_1 },
                Argument.class,
                new Functor[] {
                new Functor("getName"), // $NON-NLS-1$
                new Functor("getValue") }// $NON-NLS-1$
                new Functor[] {
View Full Code Here

    private Color colorForeGraph = Color.BLACK;

    public StatGraphVisualizer() {
        super();
        model = new ObjectTableModel(COLUMNS,
                SamplingStatCalculator.class,
                new Functor[] {
                new Functor("getLabel"),                    //$NON-NLS-1$
                new Functor("getCount"),                    //$NON-NLS-1$
                new Functor("getMeanAsNumber"),                //$NON-NLS-1$
View Full Code Here

            null, // Value
    };

    public SamplerResultTab() {
        // create tables
        resultModel = new ObjectTableModel(COLUMNS_RESULT, RowResult.class, // The object used for each row
                new Functor[] {
                        new Functor("getKey"), // $NON-NLS-1$
                        new Functor("getValue") }, // $NON-NLS-1$
                new Functor[] {
                        null, null }, new Class[] {
                        String.class, String.class }, false);
        resHeadersModel = new ObjectTableModel(COLUMNS_HEADERS,
                RowResult.class, // The object used for each row
                new Functor[] {
                        new Functor("getKey"), // $NON-NLS-1$
                        new Functor("getValue") }, // $NON-NLS-1$
                new Functor[] {
                        null, null }, new Class[] {
                        String.class, String.class }, false);
        resFieldsModel = new ObjectTableModel(COLUMNS_FIELDS, RowResult.class, // The object used for each row
                new Functor[] {
                        new Functor("getKey"), // $NON-NLS-1$
                        new Functor("getValue") }, // $NON-NLS-1$
                new Functor[] {
                        null, null }, new Class[] {
View Full Code Here

            new NumberRenderer("#.0"),    // avg. pageSize
        };

    public SummaryReport() {
        super();
        model = new ObjectTableModel(COLUMNS,
                Calculator.class,// All rows have this class
                new Functor[] {
                    new Functor("getLabel"),              //$NON-NLS-1$
                    new Functor("getCount"),              //$NON-NLS-1$
                    new Functor("getMeanAsNumber"),       //$NON-NLS-1$
View Full Code Here

    private final Map<String, SamplingStatCalculator> tableRows =
        new ConcurrentHashMap<String, SamplingStatCalculator>();

    public StatVisualizer() {
        super();
        model = new ObjectTableModel(COLUMNS,
                SamplingStatCalculator.class,
                new Functor[] {
                    new Functor("getLabel"),   //$NON-NLS-1$
                    new Functor("getCount")//$NON-NLS-1$
                    new Functor("getMeanAsNumber"),   //$NON-NLS-1$
View Full Code Here

        if (!(hdrs instanceof String[])){
            throw new RuntimeException("attribute HEADERS must be a String array");           
        }
        if(clazz == String.class)
        {
            model = new ObjectTableModel((String[])hdrs,new Functor[0],new Functor[0],new Class[]{String.class});
        }
        else
        {
            Object value = descriptor.getValue(OBJECT_PROPERTIES);
            if (!(value instanceof String[])) {
                throw new RuntimeException("attribute OBJECT_PROPERTIES must be a String array");
            }
            String[] props = (String[])value;
            Functor[] writers = new Functor[props.length];
            Functor[] readers = new Functor[props.length];
            Class<?>[] editors = new Class[props.length];
            int count = 0;
            for(String propName : props)
            {
                propName = propName.substring(0,1).toUpperCase(Locale.ENGLISH) + propName.substring(1);
                writers[count] = createWriter(clazz,propName);
                readers[count] = createReader(clazz,propName);
                editors[count] = getArgForWriter(clazz,propName);
                count++;
            }
            model = new ObjectTableModel((String[])hdrs,readers,writers,editors);
        }
        model.addTableModelListener(this);
        table = new JTable(model);
        table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        table.addFocusListener(this);
View Full Code Here

            null, // Value
    };

    public SamplerResultTab() {
        // create tables
        resultModel = new ObjectTableModel(COLUMNS_RESULT, RowResult.class, // The object used for each row
                new Functor[] {
                        new Functor("getKey"), // $NON-NLS-1$
                        new Functor("getValue") }, // $NON-NLS-1$
                new Functor[] {
                        null, null }, new Class[] {
                        String.class, String.class }, false);
        resHeadersModel = new ObjectTableModel(COLUMNS_HEADERS,
                RowResult.class, // The object used for each row
                new Functor[] {
                        new Functor("getKey"), // $NON-NLS-1$
                        new Functor("getValue") }, // $NON-NLS-1$
                new Functor[] {
                        null, null }, new Class[] {
                        String.class, String.class }, false);
        resFieldsModel = new ObjectTableModel(COLUMNS_FIELDS, RowResult.class, // The object used for each row
                new Functor[] {
                        new Functor("getKey"), // $NON-NLS-1$
                        new Functor("getValue") }, // $NON-NLS-1$
                new Functor[] {
                        null, null }, new Class[] {
View Full Code Here

    private transient Matcher matcher = null;

    public StatGraphVisualizer() {
        super();
        model = new ObjectTableModel(COLUMNS,
                SamplingStatCalculator.class,
                new Functor[] {
                new Functor("getLabel"),                    //$NON-NLS-1$
                new Functor("getCount"),                    //$NON-NLS-1$
                new Functor("getMeanAsNumber"),                //$NON-NLS-1$
View Full Code Here

TOP

Related Classes of org.apache.jorphan.gui.ObjectTableModel

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.