@Override protected Divider createDivider() { return new DividerImpl() { @Override protected void paintComponent(Graphics g) { super.paintComponent(g); if (myPainter != null) myPainter.paint(g, this); } }; }
private boolean canProcessCursorFor(Component target) { if (target instanceof JMenu || target instanceof JMenuItem || target instanceof Divider || target instanceof JSeparator || (target instanceof JEditorPane && ((JEditorPane)target).getEditorKit() instanceof HTMLEditorKit)) { return false; } return true; }
protected Divider createDivider() { return new DividerImpl(){ public void paint(Graphics g) { super.paint(g); myPaint.paint(g, this); myData.drawOnDivider(g, this); } }; }
@Override protected Divider createDivider() { return new DividerImpl() { @Override public void setOrientation(boolean isVerticalSplit) { if (!isVertical()) LOG.warn("unsupported state: splitter should be vertical"); removeAll(); setCursor(Cursor.getPredefinedCursor(Cursor.N_RESIZE_CURSOR)); JLabel label = new JLabel(myLabelText); label.setFont(UIUtil.getOptionPaneMessageFont()); label.setForeground(UIUtil.getLabelForeground()); add(label, new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.NONE, JBUI.insets(2), 0, 0)); setDividerWidth(label.getPreferredSize().height + JBUI.scale(4)); revalidate(); repaint(); } @Override protected void paintComponent(Graphics g) { super.paintComponent(g); g.setColor(JBColor.border()); UIUtil.drawLine(g, 0, 0, getWidth(), 0); } }; }
@Override protected Divider createDivider() { return new DividerImpl() { @Override public void setOrientation(boolean isVerticalSplit) { removeAll(); setCursor(Cursor.getPredefinedCursor(Cursor.W_RESIZE_CURSOR)); List<JComponent> actionComponents = ContainerUtil.list(createActionComponent(myTopAction), createActionComponent(myBottomAction)); List<JComponent> syncComponents = DiffUtil.createSyncHeightComponents(actionComponents); GridBag bag = new GridBag(); if (syncComponents.get(0) != null) { add(syncComponents.get(0), bag.nextLine()); add(Box.createVerticalStrut(JBUI.scale(20)), bag.nextLine()); } add(new JLabel(AllIcons.General.SplitGlueH), bag.nextLine()); if (syncComponents.get(1) != null) { add(Box.createVerticalStrut(JBUI.scale(20)), bag.nextLine()); add(syncComponents.get(1), bag.nextLine()); } revalidate(); repaint(); } @Override protected void paintComponent(Graphics g) { super.paintComponent(g); if (myPainter != null) myPainter.paint(g, this); } }; }
@Override protected Divider createDivider() { return new DividerImpl(){ @Override public void paint(Graphics g) { super.paint(g); myPaint.paint(g, this); myData.drawOnDivider(g, this); } }; }
@Override protected Divider createDivider() { return new OnePixelDivider(isVertical(), this); }