public void setViewportView(Component view) { setPreferredSize(new Dimension((int)view.getSize().getWidth(), (int)view.getSize().getHeight())); if (view instanceof JComponent) { setDefaultInputMap((JComponent) view); setDefaultActionMap((JComponent) view); } addResizeListener(view); super.setViewportView(view); }
/** Invoked when the component's size changes. Reset scrollable increment, because * page-down/up is relative to current view size. */ public void componentResized(ComponentEvent e) { JScrollBar bar = getVerticalScrollBar(); // NOTE: use the scroll pane size--the XHTMLPanel size is a virtual size of the entire // page // want to page down leaving the current line at the bottom be the first at the top // TODO: this will only work once unit increment is set correctly; multiplier is a workaround (PWW 28-01-05) int incr = (int)(getSize().getHeight() - (bar.getUnitIncrement(1) * 3)); getVerticalScrollBar().setBlockIncrement(incr); } });
/** Instantiates a new FSScrollPane around the given Panel; see class documentation. */ public FSScrollPane(JPanel aview) { super(aview, VERTICAL_SCROLLBAR_ALWAYS, HORIZONTAL_SCROLLBAR_ALWAYS); // TODO: need to get line-height, I think; this should not be fixed (PWW 28-01-05) getVerticalScrollBar().setUnitIncrement(15); }
fSScrollPane1 = new FSScrollPane(); xHTMLPanel1 = new XHTMLPanel(); ); fSScrollPane1.setViewportView(xHTMLPanel1);
/** * The default constructor for ReportView. * * @param core * @param controller * @param model */ public ReportView(final AppletCore core, final ValidationWizardController controller, final ValidationModel model) { super(core, controller, model); detailedReportValueHolder = new ValueHolder(""); diagnosticValueHolder = new ValueHolder(""); simpleReportValueHolder = new ValueHolder(""); if (DISPLAY_PLAINTEXT_REPORTS) { detailedReportText = ComponentFactory.createTextArea(detailedReportValueHolder); detailedReportText.setTabSize(2); simpleReportText = ComponentFactory.createTextArea(simpleReportValueHolder); simpleReportText.setTabSize(2); diagnosticText = ComponentFactory.createTextArea(diagnosticValueHolder); diagnosticText.setTabSize(2); } diagnostic = ComponentFactory.tree("Diagnostic", new DefaultTreeModel(null)); simpleReportHtmlPanel = new XHTMLPanel(); simpleReportScrollPane = new FSScrollPane(simpleReportHtmlPanel); detailedReportHtmlPanel = new XHTMLPanel(); detailedReportScrollPane = new FSScrollPane(detailedReportHtmlPanel); }
/** Instantiates a new FSScrollPane around the given Panel; see class documentation. */ public FSScrollPane(JPanel aview) { super(aview, VERTICAL_SCROLLBAR_ALWAYS, HORIZONTAL_SCROLLBAR_ALWAYS); // TODO: need to get line-height, I think; this should not be fixed (PWW 28-01-05) getVerticalScrollBar().setUnitIncrement(15); }
fSScrollPane1 = new FSScrollPane(); xHTMLPanel1 = new XHTMLPanel(); ); fSScrollPane1.setViewportView(xHTMLPanel1);
public void init() throws Exception { Container contentPane = this.getContentPane(); XHTMLPanel panel = new XHTMLPanel(); panel.getSharedContext().getTextRenderer().setSmoothingThreshold(0); // Anti-aliasing for all font sizes panel.setDocument(new File("c:\\Temp\\MyExperiment\\T2 BioCatalogue Plugin\\BioCatalogue Plugin\\resources\\test.html")); FSScrollPane scroll = new FSScrollPane(panel); contentPane.add(scroll); this.setTitle("XHTML rendered test"); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.pack(); this.setSize(1024, 768); }
public void setViewportView(Component view) { setPreferredSize(new Dimension((int)view.getSize().getWidth(), (int)view.getSize().getHeight())); if (view instanceof JComponent) { setDefaultInputMap((JComponent) view); setDefaultActionMap((JComponent) view); } addResizeListener(view); super.setViewportView(view); }
public void actionPerformed(ActionEvent evt) { JScrollBar sb = getVerticalScrollBar(); sb.getModel().setValue(0); } });
/** Invoked when the component's size changes. Reset scrollable increment, because * page-down/up is relative to current view size. */ public void componentResized(ComponentEvent e) { JScrollBar bar = getVerticalScrollBar(); // NOTE: use the scroll pane size--the XHTMLPanel size is a virtual size of the entire // page // want to page down leaving the current line at the bottom be the first at the top // TODO: this will only work once unit increment is set correctly; multiplier is a workaround (PWW 28-01-05) int incr = (int)(getSize().getHeight() - (bar.getUnitIncrement(1) * 3)); getVerticalScrollBar().setBlockIncrement(incr); } });
public void actionPerformed(ActionEvent evt) { JScrollBar sb = getVerticalScrollBar(); sb.getModel().setValue(0); } });
public void actionPerformed(ActionEvent evt) { JScrollBar sb = getVerticalScrollBar(); sb.getModel().setValue(sb.getModel().getMaximum()); } });
public void actionPerformed(ActionEvent evt) { JScrollBar sb = getVerticalScrollBar(); sb.getModel().setValue(sb.getModel().getMaximum()); } });
public void actionPerformed(ActionEvent evt) { JScrollBar sb = getVerticalScrollBar(); sb.getModel().setValue(sb.getModel().getValue() - sb.getUnitIncrement(-1)); } });
public void actionPerformed(ActionEvent evt) { JScrollBar sb = getVerticalScrollBar(); sb.getModel().setValue(sb.getModel().getValue() - sb.getBlockIncrement(-1)); } });
public void actionPerformed(ActionEvent evt) { JScrollBar sb = getVerticalScrollBar(); sb.getModel().setValue(sb.getModel().getValue() + sb.getBlockIncrement(1)); } });
public void actionPerformed(ActionEvent evt) { JScrollBar sb = getVerticalScrollBar(); sb.getModel().setValue(sb.getModel().getValue() + sb.getUnitIncrement(1)); } });
public void actionPerformed(ActionEvent evt) { JScrollBar sb = getVerticalScrollBar(); sb.getModel().setValue(sb.getModel().getValue() - sb.getBlockIncrement(-1)); } });
public void actionPerformed(ActionEvent evt) { JScrollBar sb = getVerticalScrollBar(); sb.getModel().setValue(sb.getModel().getValue() + sb.getBlockIncrement(1)); } });