• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java JBSwingUtilities类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中com.intellij.util.ui.JBSwingUtilities的典型用法代码示例。如果您正苦于以下问题:Java JBSwingUtilities类的具体用法?Java JBSwingUtilities怎么用?Java JBSwingUtilities使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

JBSwingUtilities类属于com.intellij.util.ui包,在下文中一共展示了JBSwingUtilities类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: render

点赞 2

import com.intellij.util.ui.JBSwingUtilities; //导入依赖的package包/类
public void render(Component c, Graphics g, int x, int y, int width, int height) {
    if (!(c.getParent() instanceof JViewport)) {
        return;
    }
    JViewport viewport = (JViewport) c.getParent();
    width = viewport.getWidth();
    height = viewport.getHeight();
    x = viewport.getViewRect().x;
    y = viewport.getViewRect().y;

    if (isHide(width, height)) {
        return;
    }
    Instant now = Instant.now();

    int imageWidth = characterBase.getWidth();
    int imageHeight = characterBase.getHeight();
    int margin = ImageUtil.defaultScale(30);
    int charaX = width - imageWidth - margin + x;
    int charaY = height - imageHeight + y;
    Graphics2D g2d = JBSwingUtilities.runGlobalCGTransform((JComponent) c, g);
    CharacterPosition position = CharacterPosition.of(charaX, charaY);

    g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.3f));
    ImageUtil.drawImage(g2d, characterBase, charaX, charaY);
    faceRenderer.render(now, g2d, position, riho);
    g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1));
    emotionRenderer.render(now, g2d, position, riho);
}
 

开发者ID:orekyuu,
项目名称:Riho,
代码行数:30,
代码来源:CharacterRenderer.java

示例2: findJList

点赞 2

import com.intellij.util.ui.JBSwingUtilities; //导入依赖的package包/类
static JList findJList(ListPopup popup) {
    Set<Component> lists = JBSwingUtilities.uiTraverser().preOrderTraversal(popup.getContent())
            .filter(new FilteringIterator.InstanceOf<>(JList.class)).toSet();
    if ( lists.size() != 1 ) {
        throw new IllegalStateException("Expected exactly one JList");
    }
    return (JList)lists.iterator().next();
}
 

开发者ID:Abnaxos,
项目名称:guards,
代码行数:9,
代码来源:GuardPopupController.java

示例3: ExtendedKeyboardActionDispatcher

点赞 2

import com.intellij.util.ui.JBSwingUtilities; //导入依赖的package包/类
ExtendedKeyboardActionDispatcher(ListPopup popup) {
    this.popup = popup;
    Set<Component> lists = JBSwingUtilities.uiTraverser().preOrderTraversal(popup.getContent())
            .filter(new FilteringIterator.InstanceOf<>(JList.class)).toSet();
    if ( lists.size() != 1 ) {
        list = null;
    }
    else {
        list = (JList)lists.iterator().next();
    }
}
 

开发者ID:Abnaxos,
项目名称:guards,
代码行数:12,
代码来源:ExtendedKeyboardActionDispatcher.java

示例4: createTemporaryBackgroundTransform

点赞 2

import com.intellij.util.ui.JBSwingUtilities; //导入依赖的package包/类
public static void createTemporaryBackgroundTransform(JPanel root, String tmp, Disposable disposable) {
  PaintersHelper paintersHelper = new PaintersHelper(root);
  PaintersHelper.initWallpaperPainter(tmp, paintersHelper);
  Disposer.register(disposable, JBSwingUtilities.addGlobalCGTransform((t, v) -> {
    if (!UIUtil.isAncestor(root, t)) return v;
    return MyGraphics.wrap(v, paintersHelper, t);
  }));
}
 

开发者ID:consulo,
项目名称:consulo,
代码行数:9,
代码来源:IdeBackgroundUtil.java

示例5: processMouseMotionEvent

点赞 2

import com.intellij.util.ui.JBSwingUtilities; //导入依赖的package包/类
@Override
protected void processMouseMotionEvent(MouseEvent e) {
  if (SystemInfo.isMac && JBSwingUtilities.isRightMouseButton(e) && e.getID() == MouseEvent.MOUSE_DRAGGED) return;
  super.processMouseMotionEvent(e);
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:6,
代码来源:DnDAwareTree.java

示例6: getComponentGraphics

点赞 2

import com.intellij.util.ui.JBSwingUtilities; //导入依赖的package包/类
@Override
protected Graphics getComponentGraphics(final Graphics graphics) {
  return JBSwingUtilities.runGlobalCGTransform(this, super.getComponentGraphics(graphics));
}
 

开发者ID:ChrisRM,
项目名称:material-theme-jetbrains,
代码行数:5,
代码来源:MTFrameComponentExtension.java

示例7: getComponentGraphics

点赞 2

import com.intellij.util.ui.JBSwingUtilities; //导入依赖的package包/类
@Override
protected Graphics getComponentGraphics(Graphics graphics) {
  return JBSwingUtilities.runGlobalCGTransform(this, super.getComponentGraphics(graphics));
}
 

开发者ID:consulo,
项目名称:consulo,
代码行数:5,
代码来源:JBPanelWithEmptyText.java

示例8: getComponentGraphics

点赞 2

import com.intellij.util.ui.JBSwingUtilities; //导入依赖的package包/类
@Override
protected Graphics getComponentGraphics(Graphics g) {
  return JBSwingUtilities.runGlobalCGTransform(this, super.getComponentGraphics(g));
}
 

开发者ID:consulo,
项目名称:consulo,
代码行数:5,
代码来源:TextEditorComponent.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)