Package jmt.framework.gui.table.editors

Examples of jmt.framework.gui.table.editors.ButtonCellEditor


    //returns a component to be contained inside a table column(or cell)
    @Override
    public TableCellRenderer getCellRenderer(int row, int column) {
      // Delete buttons
      if (column == 5 && row > 0) {
        return new ButtonCellEditor(deleteButton);
      } else if (column == 5 && row == 0) {
        return getDefaultRenderer(String.class);
      } else if (column == 2) {
        return ComboBoxCellEditor.getRendererInstance();
      } else {
View Full Code Here


    @Override
    public TableCellEditor getCellEditor(int row, int column) {
      if (column == 2) {
        return distributionEditor;
      } else if (column == 5) {
        return new ButtonCellEditor(new JButton(deleteRange));
      } else {
        return super.getCellEditor(row, column);
      }
    }
View Full Code Here

        return comboEditor.getRenderer();
      } else if (column == 5) {
        /*if distribution column contains null value, no editor must be displayed,
        as this class is a closed one (e.g. described by population)*/
        if (getValueAt(row, column - 1) != null) {
          return new ButtonCellEditor(editDistributionButton);
        } else {
          return getDefaultRenderer(String.class);
        }
      }
      //Addition of column that contains delete buttons
      if (column == 6) {
        return new ButtonCellEditor(deleteButton);
      } else {
        return getDefaultRenderer(getModel().getColumnClass(column));
      }
    }
View Full Code Here

    @Override
    public TableCellEditor getCellEditor(int row, int column) {
      if (column == 1) {
        return comboEditor.getEditor(classTypes);
      } else if (column == 5 && getValueAt(row, column - 1) != null) {
        return new ButtonCellEditor(new JButton(editDistribution));
      } else if (column == 6) {
        return new ButtonCellEditor(new JButton(deleteClass));
      } else {
        return super.getCellEditor(row, column);
      }
    }
View Full Code Here

     */
    public StationTable() {
      super(new StationTableModel());
      setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
      delete.setFocusable(false);
      deleteRenderer = new ButtonCellEditor(delete);
      getColumnModel().getColumn(1).setMaxWidth(ROW_HEIGHT);
      getColumnModel().setColumnSelectionAllowed(false);
      setRowHeight(ROW_HEIGHT);
    }
View Full Code Here

     * @see javax.swing.DefaultCellEditor
     */
    @Override
    public TableCellEditor getCellEditor(int row, int column) {
      if (column == 1) {
        return new ButtonCellEditor(delete);
      } else {
        // Builds an ordered array with station keys that can be added and current one
        SortedSet<Object> tmp = new TreeSet<Object>(bd.getBlockableStationKeys());
        tmp.add(stations.get(row));
        return comboFactory.getEditor(tmp.toArray());
View Full Code Here

            Integer from = mapRowIndexAndFrom.get(row);
            LoadDependentRouting.EmpiricalEntry[] columnEntries = routingStrategy.getEmpiricalEntryForFrom(from);
            int deleteButtonPosition = 2 + (columnEntries.length - 1) + 1;
            if (column == deleteButtonPosition && row > 0) {
        return new ButtonCellEditor(deleteButton);
      } else if (column == deleteButtonPosition && row == 0) {
        return getDefaultRenderer(String.class);
      } else {
        return getDefaultRenderer(getModel().getColumnClass(column));
      }
View Full Code Here

    public TableCellEditor getCellEditor(int row, int column) {
            Integer from = mapRowIndexAndFrom.get(row);
            LoadDependentRouting.EmpiricalEntry[] columnEntries = routingStrategy.getEmpiricalEntryForFrom(from);
            int deleteButtonPosition = 2 + (columnEntries.length - 1) + 1;
            if (column == deleteButtonPosition && row > 0) {
           return new ButtonCellEditor(new JButton(deleteRange));
      } else {
        return super.getCellEditor(row, column);
      }
    }
View Full Code Here

    }

    @Override
    public TableCellEditor getCellEditor(int row, int column) {
      if (column == 6) {
        return new ButtonCellEditor(deleteButton);
      } else if (column == 2 && simData.isSinkMeasure(simData.getMeasureKeys().get(row))) {
        return stationsCombos.getEditor(stationData.getStationKeysSink());
      } else if (column == 2 && simData.getMeasureType(simData.getMeasureKeys().get(row)).equals(SimulationDefinition.MEASURE_X)) {
        Vector<Object> l1 = stationData.getStationRegionKeysNoSourceSink();
        Vector<Object> l2 = stationData.getStationKeysSource();
View Full Code Here

    }

    @Override
    public TableCellRenderer getCellRenderer(int row, int column) {
      if (column == 6) {
        return new ButtonCellEditor(deleteButton);
      } else if (column == 2 && !simData.isGlobalMeasure(simData.getMeasureKeys().get(row))) {
        return stationsCombos.getRenderer();
      } else if (column == 1) {
        return classesCombos.getRenderer();
      } else {
View Full Code Here

TOP

Related Classes of jmt.framework.gui.table.editors.ButtonCellEditor

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.