@Override public void run() { int width = view.getWidth(); view.getOutline().getColumnModel().getColumn(0).setPreferredWidth(width * 40 / 100); view.getOutline().getColumnModel().getColumn(1).setPreferredWidth(width * 20 / 100); view.getOutline().getColumnModel().getColumn(2).setPreferredWidth(width * 40 / 100); } });
public void run() { int width = getWidth(); getOutline().getColumnModel().getColumn(0).setPreferredWidth(width * 40 / 100); getOutline().getColumnModel().getColumn(1).setPreferredWidth(width * 60 / 100); } });
@Override public void run() { if (getOutline().getColumnCount() == 4) { int width = getWidth(); getOutline().getColumnModel().getColumn(0).setPreferredWidth(width * 25 / 100); getOutline().getColumnModel().getColumn(1).setPreferredWidth(width * 15 / 100); getOutline().getColumnModel().getColumn(2).setPreferredWidth(width * 10 / 100); getOutline().getColumnModel().getColumn(3).setPreferredWidth(width * 50 / 100); } } });
@Override public void actionPerformed(ActionEvent e) { // ok, do the sorting int column = columnNumber; ETableColumnModel columnModel = null; if (outline.getColumnModel() instanceof ETableColumnModel) { columnModel = (ETableColumnModel) outline.getColumnModel(); columnModel.clearSortedColumns(); } boolean asc = !ascColumnValues.containsKey(column) ? true : ascColumnValues.get(column); outline.setColumnSorted(column, asc, 1); ascColumnValues.put(column, !asc); outline.getTableHeader().resizeAndRepaint(); } });
public Rectangle getNodeDimensions(Object value, int row, int depth, boolean expanded, Rectangle bounds) { int wid = Outline.this.getColumnModel().getColumn(0).getPreferredWidth(); bounds.setBounds (0, row * getRowHeight(), wid, getRowHeight()); return bounds; }
public ToolTipView() { final OutlineView ov = new OutlineView(); ov.setPropertyColumns("value", "Value"); //NOI18N ov.getOutline().getColumnModel().getColumn(0).setHeaderValue("Name"); //NOI18N ov.getOutline().setRootVisible(true); ov.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); setBorder(BorderFactory.createCompoundBorder( BorderFactory.createLineBorder(getForeground()), BorderFactory.createEmptyBorder(0, 0, 0, 0))); setLayout(new BorderLayout()); add(ov, BorderLayout.CENTER); }
@SuppressWarnings("unchecked") private void setupColumns() { ResourceBundle loc = NbBundle.getBundle(DiffTreeTable.class); setPropertyColumns(RevisionNode.COLUMN_NAME_PATH, loc.getString("LBL_DiffTree_Column_Path"), RevisionNode.COLUMN_NAME_DATE, loc.getString("LBL_DiffTree_Column_Time"), RevisionNode.COLUMN_NAME_USERNAME, loc.getString("LBL_DiffTree_Column_Username"), RevisionNode.COLUMN_NAME_MESSAGE, loc.getString("LBL_DiffTree_Column_Message")); setPropertyColumnDescription(RevisionNode.COLUMN_NAME_PATH, loc.getString("LBL_DiffTree_Column_Path_Desc")); setPropertyColumnDescription(RevisionNode.COLUMN_NAME_DATE, loc.getString("LBL_DiffTree_Column_Time_Desc")); setPropertyColumnDescription(RevisionNode.COLUMN_NAME_USERNAME, loc.getString("LBL_DiffTree_Column_Username_Desc")); setPropertyColumnDescription(RevisionNode.COLUMN_NAME_MESSAGE, loc.getString("LBL_DiffTree_Column_Message_Desc")); TableColumnModel model = getOutline().getColumnModel(); if (model instanceof ETableColumnModel) { ((ETableColumnModel) model).setColumnHidden(model.getColumn(1), true); } TableColumn column = getOutline().getColumn(loc.getString("LBL_DiffTree_Column_Message")); column.setCellRenderer(new MessageRenderer(getOutline().getDefaultRenderer(String.class))); setDefaultColumnSizes(); }
private void initView() { setLayout(new BorderLayout()); outlineView = new OutlineView(nodesColumnName); outlineView.setPropertyColumns(COLUMN_NAMES); final Outline outline = outlineView.getOutline(); outline.setRootVisible(false); DefaultTableCellRenderer decimalTableCellRenderer = new StringDecimalFormatRenderer(); outline.setDefaultRenderer(Double.class, decimalTableCellRenderer); outline.setDefaultRenderer(Float.class, decimalTableCellRenderer); outline.setDefaultRenderer(Node.Property.class, new MetadataOutlineCellRenderer()); final TableColumnModel columnModel = outline.getColumnModel(); columnModel.getColumn(0).setCellRenderer(new MetadataOutlineCellRenderer()); final int[] columnWidths = COLUMN_WIDTHS; for (int i = 0; i < columnModel.getColumnCount(); i++) { columnModel.getColumn(i).setPreferredWidth(columnWidths[i]); } add(outlineView, BorderLayout.CENTER); }
TableColumnModel columnModel = resultsOutline.getColumnModel();
public AbstractListViewTable(String nodeColumnName) { super(nodeColumnName); setDragSource(false); setDropTarget(false); setAllowedDragActions(DnDConstants.ACTION_NONE); setAllowedDropActions(DnDConstants.ACTION_NONE); final Outline outline = getOutline(); outline.setRootVisible(false); outline.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); outline.getTableHeader().setReorderingAllowed(false); outline.setRootVisible(false); ETableColumnModel colModel = (ETableColumnModel) getOutline().getColumnModel(); TableColumn firstColumn = colModel.getColumn(0); ETableColumn col = (ETableColumn) firstColumn; col.setNestedComparator(new Comparator<Node>() { @Override public int compare(Node o1, Node o2) { return o1.getName().compareTo(o2.getName()); } }); }
TableColumnModel columnModel = resultsOutline.getColumnModel();
outline.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 14)); outline.setModel(DefaultOutlineModel.createOutlineModel(treeModel, rowModel)); outline.getColumnModel().getColumn(1).setMinWidth(150);