Icon toolIcon = content.getIcon();
switch (anchor) {
case BOTTOM:
case TOP:
representativeAnchor = new ContentRepresentativeAnchor(this, labelText, toolIcon, JLabel.CENTER);
break;
case LEFT:
if (SwingUtil.getBoolean(MyDoggyKeySpace.TWRA_ROTATE_ICON_ON_ANCHOR, false) && toolIcon != null)
toolIcon = GraphicsUtil.rotate(toolIcon, -Math.PI/2);
TextIcon textIcon = new TextIcon(parent, labelText, TextIcon.ROTATE_LEFT);
textIcon.setForeground(UIManager.getColor(MyDoggyKeySpace.TWRA_FOREGROUND));
AggregateIcon compositeIcon = new AggregateIcon(textIcon, toolIcon, SwingConstants.VERTICAL);
representativeAnchor = new ContentRepresentativeAnchor(this, compositeIcon, JLabel.CENTER);
break;
case RIGHT:
if (SwingUtil.getBoolean(MyDoggyKeySpace.TWRA_ROTATE_ICON_ON_ANCHOR, false) && toolIcon != null)
toolIcon = GraphicsUtil.rotate(toolIcon, Math.PI/2);
textIcon = new TextIcon(parent, labelText, TextIcon.ROTATE_RIGHT);
textIcon.setForeground(UIManager.getColor(MyDoggyKeySpace.TWRA_FOREGROUND));
compositeIcon = new AggregateIcon(toolIcon, textIcon, SwingConstants.VERTICAL);
representativeAnchor = new ContentRepresentativeAnchor(this, compositeIcon, JLabel.CENTER);
break;
}
representativeAnchor.setName("toolWindow.rb." + content.getId());
representativeAnchor.setOpaque(true);