Tabnine Logo
SortableTableModel.sortByColumn
Code IndexAdd Tabnine to your IDE (free)

How to use
sortByColumn
method
in
org.jfree.ui.SortableTableModel

Best Java code snippets using org.jfree.ui.SortableTableModel.sortByColumn (Showing top 12 results out of 315)

origin: org.jfree/com.springsource.org.jfree

/**
 * Sorts on the specified column.
 *
 * @param column  the column index.
 * @param ascending  a flag that controls the sort order.
 *
 */
public void sortByColumn(final int column, final boolean ascending) {
  if (isSortable(column)) {
    super.sortByColumn(column, ascending);
    Collections.sort(this.properties, new SystemPropertyComparator(ascending));
  }
}
origin: org.jfree/jcommon

/**
 * Sorts on the specified column.
 *
 * @param column  the column index.
 * @param ascending  a flag that controls the sort order.
 *
 */
public void sortByColumn(final int column, final boolean ascending) {
  if (isSortable(column)) {
    super.sortByColumn(column, ascending);
    Collections.sort(this.properties,
        new SystemPropertyComparator(ascending));
  }
}
origin: jfree/jcommon

/**
 * Sorts on the specified column.
 *
 * @param column  the column index.
 * @param ascending  a flag that controls the sort order.
 *
 */
public void sortByColumn(final int column, final boolean ascending) {
  if (isSortable(column)) {
    super.sortByColumn(column, ascending);
    Collections.sort(this.properties,
        new SystemPropertyComparator(ascending));
  }
}
origin: jfree/jcommon

/**
 * Changes the model for the table.  Takes care of updating the header listener at the
 * same time.
 *
 * @param model  the table model.
 *
 */
public void setSortableModel(final SortableTableModel model) {
  super.setModel(model);
  this.headerListener.setTableModel(model);
  final SortButtonRenderer renderer = new SortButtonRenderer();
  final TableColumnModel cm = getColumnModel();
  for (int i = 0; i < cm.getColumnCount(); i++) {
    cm.getColumn(i).setHeaderRenderer(renderer);
  }
  model.sortByColumn(0, true);
}
origin: org.jfree/com.springsource.org.jfree

/**
 * Changes the model for the table.  Takes care of updating the header listener at the
 * same time.
 *
 * @param model  the table model.
 *
 */
public void setSortableModel(final SortableTableModel model) {
  super.setModel(model);
  this.headerListener.setTableModel(model);
  final SortButtonRenderer renderer = new SortButtonRenderer();
  final TableColumnModel cm = getColumnModel();
  for (int i = 0; i < cm.getColumnCount(); i++) {
    cm.getColumn(i).setHeaderRenderer(renderer);
  }
  model.sortByColumn(0, true);
}
origin: org.jfree/jcommon

/**
 * Changes the model for the table.  Takes care of updating the header listener at the
 * same time.
 *
 * @param model  the table model.
 *
 */
public void setSortableModel(final SortableTableModel model) {
  super.setModel(model);
  this.headerListener.setTableModel(model);
  final SortButtonRenderer renderer = new SortButtonRenderer();
  final TableColumnModel cm = getColumnModel();
  for (int i = 0; i < cm.getColumnCount(); i++) {
    cm.getColumn(i).setHeaderRenderer(renderer);
  }
  model.sortByColumn(0, true);
}
origin: org.jfree/com.springsource.org.jfree

/**
 * When the user releases the mouse button, we attempt to sort the table.
 *
 * @param e  the mouse event.
 */
public void mouseReleased(final MouseEvent e) {
  final JTableHeader header = (JTableHeader) e.getComponent();
  if (header.getResizingColumn() == null) {  // resizing takes precedence over sorting
    if (this.sortColumnIndex != -1) {
      final SortableTableModel model = (SortableTableModel) header.getTable().getModel();
      final boolean ascending = !model.isAscending();
      model.setAscending(ascending);
      model.sortByColumn(this.sortColumnIndex, ascending);
      this.renderer.setPressedColumn(-1);       // clear
      header.repaint();
    }
  }
}
origin: jfree/jcommon

/**
 * When the user releases the mouse button, we attempt to sort the table.
 *
 * @param e  the mouse event.
 */
public void mouseReleased(final MouseEvent e) {
  final JTableHeader header = (JTableHeader) e.getComponent();
  if (header.getResizingColumn() == null) {  // resizing takes precedence over sorting
    if (this.sortColumnIndex != -1) {
      final SortableTableModel model = (SortableTableModel) header.getTable().getModel();
      final boolean ascending = !model.isAscending();
      model.setAscending(ascending);
      model.sortByColumn(this.sortColumnIndex, ascending);
      this.renderer.setPressedColumn(-1);       // clear
      header.repaint();
    }
  }
}
origin: org.jfree/jcommon

/**
 * When the user releases the mouse button, we attempt to sort the table.
 *
 * @param e  the mouse event.
 */
public void mouseReleased(final MouseEvent e) {
  final JTableHeader header = (JTableHeader) e.getComponent();
  if (header.getResizingColumn() == null) {  // resizing takes precedence over sorting
    if (this.sortColumnIndex != -1) {
      final SortableTableModel model = (SortableTableModel) header.getTable().getModel();
      final boolean ascending = !model.isAscending();
      model.setAscending(ascending);
      model.sortByColumn(this.sortColumnIndex, ascending);
      this.renderer.setPressedColumn(-1);       // clear
      header.repaint();
    }
  }
}
origin: org.jfree/com.springsource.org.jfree

/**
 * Standard constructor - builds a table for the specified model.
 *
 * @param model  the data.
 */
public SortableTable(final SortableTableModel model) {
  super(model);
  final SortButtonRenderer renderer = new SortButtonRenderer();
  final TableColumnModel cm = getColumnModel();
  for (int i = 0; i < cm.getColumnCount(); i++) {
    cm.getColumn(i).setHeaderRenderer(renderer);
  }
  final JTableHeader header = getTableHeader();
  this.headerListener = new SortableTableHeaderListener(model, renderer);
  header.addMouseListener(this.headerListener);
  header.addMouseMotionListener(this.headerListener);
  model.sortByColumn(0, true);
}
origin: jfree/jcommon

/**
 * Standard constructor - builds a table for the specified model.
 *
 * @param model  the data.
 */
public SortableTable(final SortableTableModel model) {
  super(model);
  final SortButtonRenderer renderer = new SortButtonRenderer();
  final TableColumnModel cm = getColumnModel();
  for (int i = 0; i < cm.getColumnCount(); i++) {
    cm.getColumn(i).setHeaderRenderer(renderer);
  }
  final JTableHeader header = getTableHeader();
  this.headerListener = new SortableTableHeaderListener(model, renderer);
  header.addMouseListener(this.headerListener);
  header.addMouseMotionListener(this.headerListener);
  model.sortByColumn(0, true);
}
origin: org.jfree/jcommon

/**
 * Standard constructor - builds a table for the specified model.
 *
 * @param model  the data.
 */
public SortableTable(final SortableTableModel model) {
  super(model);
  final SortButtonRenderer renderer = new SortButtonRenderer();
  final TableColumnModel cm = getColumnModel();
  for (int i = 0; i < cm.getColumnCount(); i++) {
    cm.getColumn(i).setHeaderRenderer(renderer);
  }
  final JTableHeader header = getTableHeader();
  this.headerListener = new SortableTableHeaderListener(model, renderer);
  header.addMouseListener(this.headerListener);
  header.addMouseMotionListener(this.headerListener);
  model.sortByColumn(0, true);
}
org.jfree.uiSortableTableModelsortByColumn

Javadoc

Sorts the table.

Popular methods of SortableTableModel

  • getSortingColumn
    Returns the index of the sorting column, or -1 if the data is not sorted on any column.
  • isAscending
    Returns true if the data is sorted in ascending order, andfalse otherwise.
  • isSortable
    Returns a flag indicating whether or not a column is sortable.
  • setAscending
    Sets the flag that determines whether the sort order is ascending or descending.

Popular in Java

  • Finding current android device location
  • notifyDataSetChanged (ArrayAdapter)
  • putExtra (Intent)
  • getResourceAsStream (ClassLoader)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • ImageIO (javax.imageio)
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now