public void actionPerformed(ActionEvent evt) { panel.getSharedContext().getTextRenderer().setSmoothingThreshold(fontSizeThreshold); panel.repaint(); } }
public void actionPerformed(ActionEvent evt) { panel.getSharedContext().getTextRenderer().setSmoothingThreshold(fontSizeThreshold); panel.repaint(); } }
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); }
private void initComponents() { setLayout(new ProfileDisplayLayout()); LinedBoxPanel buttonsPanel = new LinedBoxPanel(true).fullyPadded(); launchButton = new JButton(_("launcher.launch")); editProfileButton = new JButton(_("launcher.editProfile")); XHTMLPanel view = new XHTMLPanel(new ResourceUserAgent()); view.getSharedContext().getTextRenderer().setSmoothingThreshold(6f); Font font = launchButton.getFont().deriveFont(13f); launchButton.setFont(font); editProfileButton.setFont(font); buttonsPanel.setBorder(BorderFactory.createEmptyBorder()); SwingHelper.removeOpaqueness(buttonsPanel); titleLabel.setFont(titleLabel.getFont().deriveFont(35f)); buttonsPanel.addElement(launchButton); buttonsPanel.addElement(editProfileButton); add(titleLabel, ProfileDisplayLayout.TITLE); add(buttonsPanel, ProfileDisplayLayout.BUTTONS); add(view, BorderLayout.CENTER); view.setDocument("/resources/default.html"); setDocumentStyle(view); }
g2r.getSharedContext().setInteractive(false); g2r.getSharedContext().setDPI(72f); g2r.getSharedContext().getTextRenderer().setSmoothingThreshold(0); g2r.getSharedContext().setUserAgentCallback(panel.getSharedContext().getUserAgentCallback()); g2r.setDocument(panel.getDocument(), panel.getSharedContext().getUac().getBaseURL());
g2r.getSharedContext().setInteractive(false); g2r.getSharedContext().setDPI(72f); g2r.getSharedContext().getTextRenderer().setSmoothingThreshold(0); g2r.getSharedContext().setUserAgentCallback(panel.getSharedContext().getUserAgentCallback()); g2r.setDocument(panel.getDocument(), panel.getSharedContext().getUac().getBaseURL());