Package javax.swing.plaf

Examples of javax.swing.plaf.TreeUI


  @RunsInEDT
  private static void toggleRowThroughTreeUI(final @Nonnull JTree tree, final @Nonnull Point p) {
    execute(new GuiTask() {
      @Override
      protected void executeInEDT() {
        TreeUI treeUI = tree.getUI();
        if (!(treeUI instanceof BasicTreeUI)) {
          throw actionFailure(concat("Can't toggle row for ", treeUI));
        }
        toggleExpandState(tree, p);
      }
View Full Code Here


  @RunsInEDT
  private static void toggleRowThroughTreeUI(final JTree tree, final Point p) {
    execute(new GuiTask() {
      protected void executeInEDT() {
        TreeUI treeUI = tree.getUI();
        if (!(treeUI instanceof BasicTreeUI)) throw actionFailure(concat("Can't toggle row for ", treeUI));
        toggleExpandState(tree, p);
      }
    });
  }
View Full Code Here

final class JTreeToggleExpandStateTask {

  @RunsInCurrentThread
  static void toggleExpandState(final JTree tree, final Point pathLocation) {
    TreePath path = tree.getPathForLocation(pathLocation.x, pathLocation.y);
    TreeUI treeUI = tree.getUI();
    assertThat(treeUI).isInstanceOf(BasicTreeUI.class);
    method("toggleExpandState").withParameterTypes(TreePath.class).in(treeUI).invoke(path);
  }
View Full Code Here

      }
    }
  }

  public static void doNotFillBackground(@NotNull final JTree tree, @NotNull final DefaultTreeCellRenderer renderer) {
    TreeUI ui = tree.getUI();
    if (ui instanceof UIUtil.MacTreeUI) {
      if (((UIUtil.MacTreeUI)ui).isWideSelection()) {
        renderer.setOpaque(false);
        try {
          final Field fillBackground = DefaultTreeCellRenderer.class.getDeclaredField("fillBackground");
View Full Code Here

        assertNull(tree.getSelectionPaths());
    }

    public void testSetUITreeUI() {
        assertNotNull(tree.getUI());
        TreeUI newUI = new TreeUI() {
            @Override
            public void cancelEditing(JTree tree) {
            }

            @Override
View Full Code Here

    this.tree = tree;
    this.hasFocus = hasFocus;
    this.setText(stringValue);

    TreeUI treeUI = tree.getUI();
    if (treeUI instanceof SubstanceTreeUI) {
      SubstanceTreeUI ui = (SubstanceTreeUI) treeUI;
      TreePathId pathId = new TreePathId(tree.getPathForRow(row));

      StateTransitionTracker.ModelStateInfo modelStateInfo = ui
View Full Code Here

        // Text
        setText ( tree.convertValueToText ( value, isSelected, expanded, leaf, row, hasFocus ) );

        // Border
        final TreeUI tui = tree.getUI ();
        final int sw = tui instanceof WebTreeUI ? ( ( WebTreeUI ) tui ).getSelectionShadeWidth () : WebTreeStyle.selectionShadeWidth;
        setMargin ( sw + 2, sw + 2, sw + 2, sw + 4 );

        // Orientation
        setComponentOrientation ( tree.getComponentOrientation () );
View Full Code Here

    public void mouseMoved ( final MouseEvent e )
    {
        // Disabled trees aren't affected
        if ( tree.isEnabled () )
        {
            final TreeUI treeUI = tree.getUI ();
            if ( treeUI instanceof WebTreeUI )
            {
                // Compute cell under point through WebTreeUI methods (to make sure that row selection type was taken into account)
                final int row = ( ( WebTreeUI ) treeUI ).getRowForPoint ( e.getPoint () );
                if ( row != -1 )
View Full Code Here

            // todo Proper editor for RTL
            // boolean ltr = tree.getComponentOrientation ().isLeftToRight ();

            if ( cellEditor instanceof WebTextField )
            {
                final TreeUI tui = tree.getUI ();
                final int sw =
                        tui instanceof WebTreeUI ? ( ( WebTreeUI ) tui ).getSelectionShadeWidth () : WebTreeStyle.selectionShadeWidth;

                // Field styling
                final WebTextField editor = ( WebTextField ) cellEditor;
View Full Code Here

        defaults.put("Tree[Enabled].collapsedIconPainter", collapsedIconPainter);
        defaults.put("Tree[Enabled].expandedIconPainter", expandedIconPainter);
        defaults.put("Tree:TreeCell[Focused+Selected].backgroundPainter", new SelectionBackgroundPainter(renderer.getBackgroundSelectionColor()));

        TreeUI treeUI = getUI();
        if (treeUI instanceof MetalTreeUI) {
            BasicTreeUI basicUI = (BasicTreeUI) treeUI;
            int size = 7;
            BufferedImage expandedIcon = new BufferedImage(size, size, BufferedImage.TYPE_INT_ARGB);
            expandedIconPainter.paint(expandedIcon.createGraphics(), null, size, size);
View Full Code Here

TOP

Related Classes of javax.swing.plaf.TreeUI

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.