• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java JBDimension类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: createPopup

import com.intellij.util.ui.JBDimension; //导入依赖的package包/类
@Nonnull
JBPopup createPopup() {
  JPanel panel = new JPanel(new BorderLayout());
  panel.add(myTextField, BorderLayout.CENTER);
  ComponentPopupBuilder builder = JBPopupFactory.getInstance().createComponentPopupBuilder(panel, myTextField)
          .setCancelOnClickOutside(true)
          .setAdText(KeymapUtil.getShortcutsText(CommonShortcuts.CTRL_ENTER.getShortcuts()) + " to finish")
          .setRequestFocus(true)
          .setResizable(true)
          .setMayBeParent(true);

  final JBPopup popup = builder.createPopup();
  popup.setMinimumSize(new JBDimension(200, 90));
  AnAction okAction = new DumbAwareAction() {
    @Override
    public void actionPerformed(@Nonnull AnActionEvent e) {
      unregisterCustomShortcutSet(popup.getContent());
      popup.closeOk(e.getInputEvent());
    }
  };
  okAction.registerCustomShortcutSet(CommonShortcuts.CTRL_ENTER, popup.getContent());
  return popup;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:24,代码来源:MultilinePopupBuilder.java


示例2: NewRecentProjectPanel

import com.intellij.util.ui.JBDimension; //导入依赖的package包/类
public NewRecentProjectPanel(Disposable parentDisposable) {
  super(parentDisposable);
  setBorder(null);
  setBackground(WelcomeScreenConstants.getProjectsBackground());
  JScrollPane scrollPane = UIUtil.findComponentOfType(this, JScrollPane.class);
  if (scrollPane != null) {
    scrollPane.setBackground(WelcomeScreenConstants.getProjectsBackground());
    JBDimension size = JBUI.size(300, 460);
    scrollPane.setSize(size);
    scrollPane.setMinimumSize(size);
    scrollPane.setPreferredSize(size);
  }
  ListWithFilter panel = UIUtil.findComponentOfType(this, ListWithFilter.class);
  if (panel != null) {
    panel.setBackground(WelcomeScreenConstants.getProjectsBackground());
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:18,代码来源:NewRecentProjectPanel.java


示例3: createIssueCountLabel

import com.intellij.util.ui.JBDimension; //导入依赖的package包/类
public static JPanel createIssueCountLabel(int issueCount, int rowHeight) {
    JPanel issueCountPanel = new JBPanel(new BorderLayout()).withBackground(UIUtil.getTableBackground());
    JLabel issueCountLabel = new JBLabel();
    issueCountPanel.add(issueCountLabel, BorderLayout.EAST);
    setIssueCountPanel(issueCount, issueCountPanel);

    issueCountLabel.setAlignmentX(Component.RIGHT_ALIGNMENT);
    issueCountLabel.setMinimumSize(new JBDimension(issueCountLabel.getMinimumSize().width, rowHeight));
    issueCountLabel.setMaximumSize(new JBDimension(issueCountLabel.getMaximumSize().width, rowHeight));

    issueCountPanel.setMinimumSize(new JBDimension(issueCountPanel.getMinimumSize().width, rowHeight));
    issueCountPanel.setMaximumSize(new JBDimension(issueCountPanel.getMaximumSize().width, rowHeight));
    return issueCountPanel;
}
 
开发者ID:JFrogDev,项目名称:jfrog-idea-plugin,代码行数:15,代码来源:ComponentUtils.java


示例4: getThumbSize

import com.intellij.util.ui.JBDimension; //导入依赖的package包/类
@Override
protected Dimension getThumbSize() {
  if (isPlainThumb()) {
    return new Dimension(JBUI.scale(20), JBUI.scale(20));
  }
  return slider.getOrientation() == JSlider.HORIZONTAL ? new JBDimension(12, 20) : new JBDimension(20, 12);
}
 
开发者ID:bulenkov,项目名称:Darcula,代码行数:8,代码来源:DarculaSliderUI.java


示例5: BalloonLayoutConfiguration

import com.intellij.util.ui.JBDimension; //导入依赖的package包/类
private BalloonLayoutConfiguration(@Nonnull Dimension iconOffset,
                                   int topSpaceHeight,
                                   int titleContentSpaceHeight,
                                   int contentActionsSpaceHeight,
                                   int titleActionsSpaceHeight,
                                   int bottomSpaceHeight) {
  this(JBUI.scale(32), iconOffset,
       topSpaceHeight, titleContentSpaceHeight, contentActionsSpaceHeight, titleActionsSpaceHeight, bottomSpaceHeight,
       JBUI.scale(16),
       new JBDimension(8, 6), JBUI.scale(7), JBUI.scale(5), JBUI.scale(15));
}
 
开发者ID:consulo,项目名称:consulo,代码行数:12,代码来源:BalloonLayoutConfiguration.java


示例6: createButton

import com.intellij.util.ui.JBDimension; //导入依赖的package包/类
private static ActionButton createButton(AnAction action) {
  Presentation presentation = action.getTemplatePresentation();
  Dimension d = new JBDimension(16, 16);
  ActionButton button = new ActionButton(action, presentation, ActionPlaces.UNKNOWN, d) {
    @Override
    protected DataContext getDataContext() {
      return DataManager.getInstance().getDataContext(this);
    }
  };
  //TODO [VISTALL] unsupported button.setLook(new InplaceActionButtonLook());
  button.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
  button.updateIcon();
  return button;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:15,代码来源:SearchTextArea.java


示例7: InstancesWindow

import com.intellij.util.ui.JBDimension; //导入依赖的package包/类
public InstancesWindow(@NotNull XDebugSession session, @NotNull InstancesProvider provider, @NotNull String className)
{
	super(session.getProject(), false);

	myProject = session.getProject();
	myDebugProcess = (DebugProcessImpl) DebuggerManager.getInstance(myProject).getDebugProcess(session.getDebugProcess().getProcessHandler());
	myInstancesProvider = provider;
	myClassName = className;

	addWarningMessage(null);
	session.addSessionListener(new XDebugSessionListener()
	{
		@Override
		public void sessionStopped()
		{
			ApplicationManager.getApplication().invokeLater(() -> close(OK_EXIT_CODE));
		}
	}, myDisposable);
	setModal(false);
	myInstancesView = new MyInstancesView(session);
	myInstancesView.setPreferredSize(new JBDimension(DEFAULT_WINDOW_WIDTH, DEFAULT_WINDOW_HEIGHT));

	init();

	JRootPane root = myInstancesView.getRootPane();
	root.setDefaultButton(myInstancesView.myFilterButton);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:28,代码来源:InstancesWindow.java


示例8: setMinimumButtonSize

import com.intellij.util.ui.JBDimension; //导入依赖的package包/类
public void setMinimumButtonSize(@NotNull Dimension size) {
  myMinimumButtonSize = JBDimension.create(size);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:ActionButton.java


示例9: setPreferredSize

import com.intellij.util.ui.JBDimension; //导入依赖的package包/类
public void setPreferredSize(boolean orientation) {
  final Dimension size = new JBDimension(orientation ? 150 : 450 , -1);
  myProgressPanel.setMaximumSize(size);
  myProgressPanel.setMinimumSize(size);
  myProgressPanel.setPreferredSize(size);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:TestStatusLine.java


示例10: parseSize

import com.intellij.util.ui.JBDimension; //导入依赖的package包/类
private static Dimension parseSize(final String value) {
  final java.util.List<String> numbers = StringUtil.split(value, ",");
  return new JBDimension(Integer.parseInt(numbers.get(0)), Integer.parseInt(numbers.get(1))).asUIResource();
}
 
开发者ID:ChrisRM,项目名称:material-theme-jetbrains,代码行数:5,代码来源:PropertiesParser.java


示例11: setMinimumButtonSize

import com.intellij.util.ui.JBDimension; //导入依赖的package包/类
public void setMinimumButtonSize(@Nonnull Dimension size) {
  myMinimumButtonSize = JBDimension.create(size);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:4,代码来源:ActionButton.java


示例12: twoLines

import com.intellij.util.ui.JBDimension; //导入依赖的package包/类
@Nonnull
private static BalloonLayoutConfiguration twoLines() {
  return new BalloonLayoutConfiguration(new JBDimension(10, 11),
                                        JBUI.scale(11), JBUI.scale(5), JBUI.scale(5), JBUI.scale(5), JBUI.scale(14));
}
 
开发者ID:consulo,项目名称:consulo,代码行数:6,代码来源:BalloonLayoutConfiguration.java


示例13: treeLines

import com.intellij.util.ui.JBDimension; //导入依赖的package包/类
@Nonnull
private static BalloonLayoutConfiguration treeLines() {
  return new BalloonLayoutConfiguration(new JBDimension(10, 7),
                                        JBUI.scale(7), JBUI.scale(3), JBUI.scale(7), 0, JBUI.scale(8));
}
 
开发者ID:consulo,项目名称:consulo,代码行数:6,代码来源:BalloonLayoutConfiguration.java


示例14: getPreferredSize

import com.intellij.util.ui.JBDimension; //导入依赖的package包/类
@Override
public Dimension getPreferredSize() {
  return new JBDimension(DEFAULT_WIDTH, DEFAULT_HEIGHT);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:5,代码来源:TipPanel.java


示例15: ClassesTable

import com.intellij.util.ui.JBDimension; //导入依赖的package包/类
public ClassesTable(@NotNull InstancesTracker tracker, @NotNull ClassesFilteredView parent, boolean onlyWithDiff, boolean onlyWithInstances, boolean onlyTracked)
{
	setModel(myModel);

	myOnlyWithDiff = onlyWithDiff;
	myOnlyWithInstances = onlyWithInstances;
	myOnlyTracked = onlyTracked;
	myInstancesTracker = tracker;
	myParent = parent;

	final TableColumnModel columnModel = getColumnModel();
	TableColumn classesColumn = columnModel.getColumn(DiffViewTableModel.CLASSNAME_COLUMN_INDEX);
	TableColumn countColumn = columnModel.getColumn(DiffViewTableModel.COUNT_COLUMN_INDEX);
	TableColumn diffColumn = columnModel.getColumn(DiffViewTableModel.DIFF_COLUMN_INDEX);

	setAutoResizeMode(AUTO_RESIZE_SUBSEQUENT_COLUMNS);
	classesColumn.setPreferredWidth(JBUI.scale(CLASSES_COLUMN_PREFERRED_WIDTH));

	countColumn.setMinWidth(JBUI.scale(COUNT_COLUMN_MIN_WIDTH));

	diffColumn.setMinWidth(JBUI.scale(DIFF_COLUMN_MIN_WIDTH));

	setShowGrid(false);
	setIntercellSpacing(new JBDimension(0, 0));

	setDefaultRenderer(ReferenceType.class, new MyClassColumnRenderer());
	setDefaultRenderer(Long.class, new MyCountColumnRenderer());
	setDefaultRenderer(DiffValue.class, new MyDiffColumnRenderer());

	TableRowSorter<DiffViewTableModel> sorter = new TableRowSorter<>(myModel);
	sorter.setRowFilter(new RowFilter<DiffViewTableModel, Integer>()
	{
		@Override
		public boolean include(Entry<? extends DiffViewTableModel, ? extends Integer> entry)
		{
			int ix = entry.getIdentifier();
			ReferenceType ref = myItems.get(ix);
			DiffValue diff = myCounts.getOrDefault(ref, UNKNOWN_VALUE);

			boolean isFilteringOptionsRefused = myOnlyWithDiff && diff.diff() == 0 || myOnlyWithInstances && !diff.hasInstance() || myOnlyTracked && myParent.getStrategy(ref) == null;
			return !(isFilteringOptionsRefused) && myMatcher.matches(ref.name());
		}
	});

	List<RowSorter.SortKey> myDefaultSortingKeys = Arrays.asList(new RowSorter.SortKey(DiffViewTableModel.DIFF_COLUMN_INDEX, SortOrder.DESCENDING), new RowSorter.SortKey(DiffViewTableModel
			.COUNT_COLUMN_INDEX, SortOrder.DESCENDING), new RowSorter.SortKey(DiffViewTableModel.CLASSNAME_COLUMN_INDEX, SortOrder.ASCENDING));
	sorter.setSortKeys(myDefaultSortingKeys);
	setRowSorter(sorter);
	setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

	myCountProvider = new ReferenceCountProvider()
	{
		@Override
		public int getTotalCount(@NotNull ReferenceType ref)
		{
			return (int) myCounts.get(ref).myCurrentCount;
		}

		@Override
		public int getDiffCount(@NotNull ReferenceType ref)
		{
			return (int) myCounts.get(ref).diff();
		}

		@Override
		public int getNewInstancesCount(@NotNull ReferenceType ref)
		{
			TrackerForNewInstances strategy = myParent.getStrategy(ref);
			return strategy == null || !strategy.isReady() ? -1 : strategy.getCount();
		}
	};
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:73,代码来源:ClassesTable.java



注:本文中的com.intellij.util.ui.JBDimension类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java InfoMessage类代码示例发布时间:2022-05-22
下一篇:
Java RestStatusToXContentListener类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap