public OWLAnnotationCellRenderer(OWLEditorKit owlEditorKit) { this.owlEditorKit = owlEditorKit; setLayout(new BorderLayout()); setBorder(BorderFactory.createEmptyBorder(1, 2, 1, 2)); annotationURILabel = new JLabel(); annotationURILabel.setForeground(LABEL_COLOR); normalFont = annotationURILabel.getFont(); activeOntologyFont = normalFont.deriveFont(Font.BOLD); annotationContentArea = new JTextArea(); annotationContentArea.setFont(new Font("Dialog", Font.PLAIN, 12)); annotationContentArea.setLineWrap(true); annotationContentArea.setWrapStyleWord(true); annotationContentArea.setOpaque(false); iconLabel = new JLabel(); iconLabel.setIcon(OWLIcons.getIcon("individual.png")); JPanel contentPanel = new JPanel(new BorderLayout(3, 3)); contentPanel.setBorder(BorderFactory.createEmptyBorder(2, 20, 2, 2)); contentPanel.setOpaque(false); contentPanel.add(annotationContentArea, BorderLayout.CENTER); contentPanel.add(iconLabel, BorderLayout.WEST); add(annotationURILabel, BorderLayout.NORTH); add(contentPanel, BorderLayout.SOUTH); }
public OWLFrameListRenderer(OWLEditorKit owlEditorKit) { this.owlEditorKit = owlEditorKit; owlCellRenderer = new OWLCellRenderer(owlEditorKit); separatorRenderer = new DefaultListCellRenderer(); annotationRenderer = new OWLAnnotationCellRenderer(owlEditorKit); highlightKeywords = true; highlightUnsatisfiableClasses = true; highlightUnsatisfiableProperties = true; annotationRendererEnabled = true; crossedOutEntities = new HashSet<OWLEntity>(); }
@SuppressWarnings("unchecked") public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { if (value instanceof AbstractAnnotationsList.AnnotationsListItem){ value = ((AbstractAnnotationsList.AnnotationsListItem)value).getAnnotation(); return super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); } return delegate.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); } });
setBackground(list.getSelectionBackground()); setBackground(list.getBackground());
if (axiom instanceof OWLAnnotationAssertionAxiom && annotationRendererEnabled) { OWLAnnotationAssertionAxiom annotationAssertionAxiom = (OWLAnnotationAssertionAxiom) axiom; annotationRenderer.setOntology(row.getOntology()); return annotationRenderer.getListCellRendererComponent(list, annotationAssertionAxiom.getAnnotation(), index,
setBackground(list.getSelectionBackground()); setBackground(list.getBackground());
public OWLAnnotationCellRenderer(OWLEditorKit owlEditorKit) { this.owlEditorKit = owlEditorKit; setLayout(new BorderLayout()); setBorder(BorderFactory.createEmptyBorder(1, 2, 1, 2)); annotationURILabel = new JLabel(); annotationURILabel.setForeground(LABEL_COLOR); normalFont = annotationURILabel.getFont(); activeOntologyFont = normalFont.deriveFont(Font.BOLD); annotationContentArea = new JTextArea(); annotationContentArea.setFont(new Font("Dialog", Font.PLAIN, 12)); annotationContentArea.setLineWrap(true); annotationContentArea.setWrapStyleWord(true); annotationContentArea.setOpaque(false); iconLabel = new JLabel(); iconLabel.setIcon(OWLIcons.getIcon("individual.png")); JPanel contentPanel = new JPanel(new BorderLayout(3, 3)); contentPanel.setBorder(BorderFactory.createEmptyBorder(2, 20, 2, 2)); contentPanel.setOpaque(false); contentPanel.add(annotationContentArea, BorderLayout.CENTER); contentPanel.add(iconLabel, BorderLayout.WEST); add(annotationURILabel, BorderLayout.NORTH); add(contentPanel, BorderLayout.SOUTH); }
setBackground(list.getSelectionBackground()); setBackground(list.getBackground());
public OWLAnnotationCellRenderer(OWLEditorKit owlEditorKit) { this.owlEditorKit = owlEditorKit; setLayout(new BorderLayout()); setBorder(BorderFactory.createEmptyBorder(1, 2, 1, 2)); annotationURILabel = new JLabel(); annotationURILabel.setForeground(LABEL_COLOR); normalFont = annotationURILabel.getFont(); activeOntologyFont = normalFont.deriveFont(Font.BOLD); annotationContentArea = new JTextArea(); annotationContentArea.setFont(new Font("Dialog", Font.PLAIN, 12)); annotationContentArea.setLineWrap(true); annotationContentArea.setWrapStyleWord(true); annotationContentArea.setOpaque(false); iconLabel = new JLabel(); iconLabel.setIcon(OWLIcons.getIcon("individual.png")); JPanel contentPanel = new JPanel(new BorderLayout(3, 3)); contentPanel.setBorder(BorderFactory.createEmptyBorder(2, 20, 2, 2)); contentPanel.setOpaque(false); contentPanel.add(annotationContentArea, BorderLayout.CENTER); contentPanel.add(iconLabel, BorderLayout.WEST); add(annotationURILabel, BorderLayout.NORTH); add(contentPanel, BorderLayout.SOUTH); }
setBackground(list.getSelectionBackground()); setBackground(list.getBackground());
public OWLAnnotationCellRenderer(OWLEditorKit owlEditorKit) { this.owlEditorKit = owlEditorKit; setLayout(new BorderLayout()); setBorder(BorderFactory.createEmptyBorder(1, 2, 1, 2)); annotationURILabel = new JLabel(); annotationURILabel.setForeground(LABEL_COLOR); normalFont = annotationURILabel.getFont(); activeOntologyFont = normalFont.deriveFont(Font.BOLD); annotationContentArea = new JTextArea(); annotationContentArea.setFont(new Font("Dialog", Font.PLAIN, 12)); annotationContentArea.setLineWrap(true); annotationContentArea.setWrapStyleWord(true); annotationContentArea.setOpaque(false); iconLabel = new JLabel(); iconLabel.setIcon(OWLIcons.getIcon("individual.png")); JPanel contentPanel = new JPanel(new BorderLayout(3, 3)); contentPanel.setBorder(BorderFactory.createEmptyBorder(2, 20, 2, 2)); contentPanel.setOpaque(false); contentPanel.add(annotationContentArea, BorderLayout.CENTER); contentPanel.add(iconLabel, BorderLayout.WEST); add(annotationURILabel, BorderLayout.NORTH); add(contentPanel, BorderLayout.SOUTH); }