+ if (element instanceof Node)
+ return getNodeToolTipText((Node) element);
+ else if (element instanceof NodeElement)
+ return getNodeToolTipText(((NodeElement) element).getNode());
+ else
+ throw new IllegalArgumentException("Unsupported element type " + element.getClass());
+ } catch (RepositoryException e) {
+ throw new IllegalStateException("Repository exception when accessing " + element, e);
+ }
+ }
+
+ @Override
+ public Font getFont(Object element) {
+ try {
+ if (element instanceof Node)
+ return getNodeFont((Node) element);
+ else if (element instanceof NodeElement)
+ return getNodeFont(((NodeElement) element).getNode());
+ else
+ throw new IllegalArgumentException("Unsupported element type " + element.getClass());
+ } catch (RepositoryException e) {
+ throw new IllegalStateException("Repository exception when accessing " + element, e);
+ }
+ }
+
+ @Override
+ public Color getBackground(Object element) {
+ try {
+ if (element instanceof Node)
+ return getNodeBackground((Node) element);
+ else if (element instanceof NodeElement)
+ return getNodeBackground(((NodeElement) element).getNode());
+ else
+ throw new IllegalArgumentException("Unsupported element type " + element.getClass());
+ } catch (RepositoryException e) {
+ throw new IllegalStateException("Repository exception when accessing " + element, e);
+ }
+ }
+
+ @Override
+ public Color getForeground(Object element) {
+ try {
+ if (element instanceof Node)
+ return getNodeForeground((Node) element);
+ else if (element instanceof NodeElement)
+ return getNodeForeground(((NodeElement) element).getNode());
+ else
+ throw new IllegalArgumentException("Unsupported element type " + element.getClass());