private void loadFromFile(File f) { if(f != null){ try{ String content = FileUtil.getContentAsString(f, Charsets.UTF_8); Dimension d = jsp_in.getPreferredSize(); jta_in.setText(content); jta_in.setCaretPosition(0); jsp_in.setPreferredSize(d); } catch(IOException ex){ ui.getView().showError(Util.getStackTrace(ex)); } } }
tm_errors.setData(result.getErrors()); Dimension d = jsp_jta_trace.getPreferredSize(); jta_trace.setText(result.toString()); jta_trace.setCaretPosition(0);
jt_res_headers.setModel(resHeaderTableModel); JScrollPane jsp = new JScrollPane(jt_res_headers); Dimension d = jsp.getPreferredSize(); d.height = d.height / 2; jsp.setPreferredSize(d);
if (relationRenderer != null) { relationRenderer.setPreferredSize( jScrollPaneT.getPreferredSize()); relationRenderer.setMaximumSize( jScrollPaneT.getPreferredSize());
/** Gets preferred size of left scroll pane. */ int getControllingViewWidth() { return controllingView.getPreferredSize().width; }
/** Gets preferred size of left scroll pane. */ int getControllingViewWidth() { return controllingView.getPreferredSize().width; } /*
public Dimension getPreferredSize() { Dimension d = super.getPreferredSize(); d.width = Math.max(d.width, 400); return d; } }, BorderLayout.CENTER);
public Dimension preferredLayoutSize(Container parent) { if (scrollPane != null) { return scrollPane.getPreferredSize(); } return new Dimension(); }
@Override public Dimension getPreferredSize() { validate(); return super.getPreferredSize(); }
@Override public Dimension getPreferredSize() { Dimension result = super.getPreferredSize(); result = new Dimension(Math.min(result.width, SelectableListView.this.getWidth() - 20), result.height); return result; } };
/** * Adjusts the size of the dialog to fit the with of the contained message and stacktrace. */ public void adjustSize() { final Dimension scSize = scroller.getPreferredSize(); final Dimension cbase = filler.getPreferredSize(); cbase.width = Math.max( scSize.width, cbase.width ); cbase.height = 0; filler.setMinimumSize( cbase ); pack(); }
@Override public void setWidth(Number width) { super.setWidth(width); int w = width.intValue(); if (w == PREFERRED || w == FILL) { return; } int height = fieldScroll.getPreferredSize().height; fieldScroll.setPreferredSize(new Dimension(w, height)); }
@Override public void setHeight(Number height) { super.setHeight(height); int h = height.intValue(); if (h == PREFERRED || h == FILL) { return; } int width = fieldScroll.getPreferredSize().width; fieldScroll.setPreferredSize(new Dimension(width, h)); }
@Override public Dimension getPreferredSize() { Dimension result = super.getPreferredSize(); result = new Dimension(Math.min(result.width, TabularFilterView.this.getWidth() - 20), result.height); return result; } };
public void run() { double mainWidth = main.getSize().getWidth(); double optionsWidth = options.getPreferredSize().getWidth(); // consider scrollbar width if visible double scrollWidth = options.getVerticalScrollBar().isVisible() ? options.getVerticalScrollBar().getWidth() : 0; double loc = (mainWidth - optionsWidth - scrollWidth) / mainWidth; if(loc>=0 && loc<=1) // Might be NaN, if plugin is switched before panel is shown. main.setDividerLocation(loc); } });
private JSplitPane createSplitPane(UpdaterWrapper updaterWrapper) { JScrollPane workbenchScroll = createWorkbenchScroll(updaterWrapper); workbenchScroll.setBorder(new TitledBorder("Manipulated Graph")); JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, workbenchScroll, createRightPanel(updaterWrapper)); splitPane.setOneTouchExpandable(true); splitPane.setDividerLocation(workbenchScroll.getPreferredSize().width); return splitPane; }
public void run() { double mainWidth = main.getWidth(); double optionsWidth = options.getPreferredSize().getWidth(); // consider scrollbar width if visible double scrollWidth = options.getVerticalScrollBar().isVisible() ? options.getVerticalScrollBar().getWidth() : 0; double loc = (mainWidth - optionsWidth - scrollWidth) / mainWidth; if(loc>=0 && loc<=1) // Might be NaN, if plugin is switched before panel is shown. main.setDividerLocation(loc); } });
public void run() { double mainWidth = main.getWidth(); double optionsWidth = options.getPreferredSize().getWidth(); // consider scrollbar width if visible double scrollWidth = options.getVerticalScrollBar().isVisible() ? options.getVerticalScrollBar().getWidth() : 0; double loc = (mainWidth - optionsWidth - scrollWidth) / mainWidth; if(loc>=0 && loc<=1) // Might be NaN, if plugin is switched before panel is shown. main.setDividerLocation(loc); } });
@Override public Dimension getPreferredSize() { if (!isValid()) { doLayout(); } return super.getPreferredSize(); } }
public ShellPanel(Activator activator) { m_activator = activator; m_activator.addPropertyChangeListener(this); setLayout(new BorderLayout()); JScrollPane scroll = null; add(scroll = new JScrollPane(m_pluginList = new JList(new SimpleListModel())), BorderLayout.WEST); scroll.setPreferredSize(new Dimension(150, scroll.getPreferredSize().height)); add(m_emptyPanel = new JPanel(), BorderLayout.CENTER); createEventListeners(); }