当前位置: 首页>>代码示例>>Java>>正文


Java JBColor类代码示例

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


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

示例1: paintComponent

import com.intellij.ui.JBColor; //导入依赖的package包/类
@Override
protected void paintComponent(final Graphics g) {
  super.paintComponent(g);

  g.setColor(JBColor.border());//UIUtil.getBorderColor() is deprecated

  if (myWestToolbar != null && myWestToolbar.getParent() == this && myContent != null && myContent.getParent() == this) {
      int x = (int) myWestToolbar.getBounds().getMaxX();
      g.drawLine(x, 0, x, getHeight());
  }

  if (myNorthToolbar != null && myNorthToolbar.getParent() == this && myContent != null && myContent.getParent() == this) {
    final int y = (int) myNorthToolbar.getBounds().getMaxY();
    g.drawLine(0, y, getWidth(), y);
  }

}
 
开发者ID:beansoftapp,项目名称:react-native-console,代码行数:18,代码来源:SimpleToolWindowPanel.java

示例2: customizeCellRenderer

import com.intellij.ui.JBColor; //导入依赖的package包/类
@Override
protected void customizeCellRenderer(JList list, Object value, int index, boolean selected, boolean hasFocus) {
    Color bgColor = UIUtil.getListBackground();
    setPaintFocusBorder(hasFocus && UIUtil.isToUseDottedCellBorder());

    if (value instanceof SearchResultElement) {
        SearchResultElement element = (SearchResultElement) value;
        String stringKeyText = "(" + element.getName() + ")";
        String text = new StringEllipsisPolicy().ellipsizeText(element.getValue(), matcher);

        SimpleTextAttributes nameAttributes = new SimpleTextAttributes(Font.PLAIN, list.getForeground());
        SpeedSearchUtil.appendColoredFragmentForMatcher(text, this, nameAttributes, matcher, bgColor, selected);
        append(" " + stringKeyText, new SimpleTextAttributes(Font.PLAIN, JBColor.GRAY));
    }

    setBackground(selected ? UIUtil.getListSelectionBackground() : bgColor);
}
 
开发者ID:hoai265,项目名称:SearchResourcePlugin,代码行数:18,代码来源:ResultElementListCellRenderer.java

示例3: drawAllAnswerPlaceholders

import com.intellij.ui.JBColor; //导入依赖的package包/类
public static void drawAllAnswerPlaceholders(Editor editor, TaskFile taskFile) {
  editor.getMarkupModel().removeAllHighlighters();
  final Project project = editor.getProject();
  if (project == null) return;
  final StudyTaskManager taskManager = StudyTaskManager.getInstance(project);
  for (AnswerPlaceholder answerPlaceholder : taskFile.getAnswerPlaceholders()) {
    final JBColor color = taskManager.getColor(answerPlaceholder);
    EduAnswerPlaceholderPainter.drawAnswerPlaceholder(editor, answerPlaceholder, color);
  }

  final Document document = editor.getDocument();
  EditorActionManager.getInstance()
    .setReadonlyFragmentModificationHandler(document, new EduAnswerPlaceholderDeleteHandler(editor));
  EduAnswerPlaceholderPainter.createGuardedBlocks(editor, taskFile);
  editor.getColorsScheme().setColor(EditorColors.READONLY_FRAGMENT_BACKGROUND_COLOR, null);
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:17,代码来源:StudyUtils.java

示例4: createCourseProgress

import com.intellij.ui.JBColor; //导入依赖的package包/类
private JPanel createCourseProgress(@NotNull final Project project) {
  JPanel contentPanel = new JPanel();
  contentPanel.setBackground(JBColor.WHITE);
  contentPanel.setLayout(new BoxLayout(contentPanel, BoxLayout.PAGE_AXIS));
  contentPanel.add(Box.createRigidArea(new Dimension(10, 0)));
  contentPanel.add(Box.createRigidArea(new Dimension(0, 10)));
  myStudyProgressBar = new StudyProgressBar(0, 20, 10);

  myStatisticLabel = new JLabel("", SwingConstants.LEFT);
  contentPanel.add(myStatisticLabel);
  contentPanel.add(myStudyProgressBar);

  contentPanel.setPreferredSize(new Dimension(100, 60));
  contentPanel.setMinimumSize(new Dimension(300, 40));
  updateCourseProgress(project);
  return contentPanel;
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:18,代码来源:StudyToolWindow.java

示例5: drawAnswerPlaceholder

import com.intellij.ui.JBColor; //导入依赖的package包/类
public static void drawAnswerPlaceholder(@NotNull final Editor editor, @NotNull final AnswerPlaceholder placeholder,
                                         @NotNull final JBColor color) {
  EditorColorsScheme scheme = EditorColorsManager.getInstance().getGlobalScheme();
  final TextAttributes textAttributes = new TextAttributes(scheme.getDefaultForeground(), scheme.getDefaultBackground(), null,
                                                           EffectType.BOXED, Font.PLAIN);
  textAttributes.setEffectColor(color);
  int startOffset = placeholder.getOffset();
  if (startOffset == -1) {
    return;
  }
  final int length =
    placeholder.isActive() ? placeholder.getRealLength() : placeholder.getVisibleLength(placeholder.getActiveSubtaskIndex());
  Pair<Integer, Integer> offsets = StudyUtils.getPlaceholderOffsets(placeholder, editor.getDocument());
  startOffset = offsets.first;
  int endOffset = offsets.second;
  if (placeholder.isActive()) {
    drawAnswerPlaceholder(editor, startOffset, endOffset, textAttributes, PLACEHOLDERS_LAYER);
  }
  else if (!placeholder.getUseLength() && length != 0) {
    drawAnswerPlaceholderFromPrevStep(editor, startOffset, endOffset);
  }
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:23,代码来源:EduAnswerPlaceholderPainter.java

示例6: refreshPdeFileImportPreview

import com.intellij.ui.JBColor; //导入依赖的package包/类
private void refreshPdeFileImportPreview() {
    if (! getParameters().importablePdeFiles.isEmpty()) {
        filesDetectedLabel.setForeground(JBColor.BLACK);
        filesDetectedLabel.setText(getParameters().importablePdeFiles.size() + " PDE files");

        StringJoiner importablePdeFilePaths = new StringJoiner("\n");

        for (VirtualFile importablePdeFile : getParameters().importablePdeFiles) {
            importablePdeFilePaths.add(importablePdeFile.getPath());
        }

        importableClassesListTextArea.setText(importablePdeFilePaths.toString());
    } else {
        importableClassesListTextArea.setText("No sketch classes were found at this root directory.");
        filesDetectedLabel.setText("0 PDE files");
        filesDetectedLabel.setForeground(JBColor.RED);
    }
}
 
开发者ID:mistodev,项目名称:processing-idea,代码行数:19,代码来源:ProcessingSketchRootSelectStep.java

示例7: getTableCellRendererComponent

import com.intellij.ui.JBColor; //导入依赖的package包/类
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int col) {
    // Cells are by default rendered as a JLabel.
    JLabel l = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, col);
    //Get the status for the current row.
    TranslationTableModel tableModel = (TranslationTableModel) table.getModel();
    if (col != 0 && tableModel.getStatus(row, col) == TranslationTableModel.EMPTY) {
        l.setBackground(new JBColor(new Color(244, 128, 36, 60), new Color(244, 128, 36)));
    } else {
        if(isSelected) {
            l.setForeground(EditorColorsManager.getInstance().getSchemeForCurrentUITheme().getDefaultForeground());
        }
        l.setBackground(EditorColorsManager.getInstance().getSchemeForCurrentUITheme().getDefaultBackground());
    }

    return l;
}
 
开发者ID:PioBeat,项目名称:GravSupport,代码行数:18,代码来源:ValueEnteredTableCellRenderer.java

示例8: update

import com.intellij.ui.JBColor; //导入依赖的package包/类
@Override
protected void update(PresentationData presentation) {
  if (getValue() != null) {
    final Object object = getValue().getObject();
    final String classString = object.getClass().toString();
    final String objectString = object.toString();

    presentation.setPresentableText(objectString);

    if (getValue().getOwnModification() < myTree.myModificationToFilter) {
      presentation.setForcedTextForeground(JBColor.GRAY);
    }

    if (objectString != null) {
      final int dogIndex = objectString.lastIndexOf("@");
      if (dogIndex >= 0) {
        final String fqNameObject = objectString.substring(0, dogIndex);
        final String fqNameClass = classString.substring("class ".length());
        if (fqNameObject.equals(fqNameClass)) return;
      }
    }

    presentation.setLocationString(classString);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:DisposerDebugger.java

示例9: CpuMonitorView

import com.intellij.ui.JBColor; //导入依赖的package包/类
public CpuMonitorView(@NotNull Project project, @NotNull DeviceContext deviceContext) {
  super(project);

  // Buffer at one and a half times the sample frequency.
  float bufferTimeInSeconds = SAMPLE_FREQUENCY_MS * 1.5f / 1000.f;
  float initialMax = 100.0f;
  float initialMarker = 10.0f;

  TimelineData data = new TimelineData(2, SAMPLES);
  EventData events = new EventData();
  TimelineComponent timelineComponent = new TimelineComponent(data, events, bufferTimeInSeconds, initialMax, 100, initialMarker);

  timelineComponent.configureUnits("%");
  timelineComponent.configureStream(0, "Kernel", new JBColor(0xd73f3f, 0xd73f3f));
  timelineComponent.configureStream(1, "User", new JBColor(0xeb9f9f, 0x9d4c4c));
  timelineComponent.setBackground(BACKGROUND_COLOR);

  setComponent(timelineComponent);

  myCpuSampler = new CpuSampler(data, SAMPLE_FREQUENCY_MS);
  myCpuSampler.addListener(this);

  myDeviceContext = deviceContext;
  myDeviceContext.addListener(this, project);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:CpuMonitorView.java

示例10: createUIComponents

import com.intellij.ui.JBColor; //导入依赖的package包/类
private void createUIComponents() {
    defaultExtensionLabel = new JBLabel(TesterBundle.message("settings.defaultExtension"));
    defaultExtensionCombobox = new ComboBox<>(new String[]{"phpt", "php"});

    bootstrapFileLabel = new JBLabel(TesterBundle.message("settings.bootstrapFile"));
    bootstrapFileField = new TextFieldWithBrowseButton();
    bootstrapFileField.addBrowseFolderListener(null, null, project, FileChooserDescriptorFactory.createSingleFileDescriptor("php"));

    namespaceMappingTable = new NamespaceMappingTable(project);
    namespaceMappingPanel = ToolbarDecorator.createDecorator(namespaceMappingTable.getTableView(), new ElementProducer<TesterNamespaceMapping>() {
        @Override
        public TesterNamespaceMapping createElement() {
            return new TesterNamespaceMapping();
        }

        @Override
        public boolean canCreateElement() {
            return true;
        }
    }).createPanel();

    namespaceMappingPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createMatteBorder(1, 0, 0, 0, JBColor.LIGHT_GRAY), TesterBundle.message("settings.namespaceMappings.title")));
}
 
开发者ID:jiripudil,项目名称:intellij-nette-tester,代码行数:24,代码来源:TesterConfigurableForm.java

示例11: SwaggerUIViewer

import com.intellij.ui.JBColor; //导入依赖的package包/类
public SwaggerUIViewer() {
    super(new BorderLayout());
    this.setBackground(JBColor.background());
    this.setVisible(false);
    Platform.setImplicitExit(false);

    ApplicationManager
            .getApplication()
            .invokeLater(() -> PlatformImpl.startup(this::createWebView));
}
 
开发者ID:zalando,项目名称:intellij-swagger,代码行数:11,代码来源:SwaggerUIViewer.java

示例12: addYayLabel

import com.intellij.ui.JBColor; //导入依赖的package包/类
private void addYayLabel() {
    logger.info("Adding yay label. @SuccessfulSubmissionDialog");
    JLabel yayLabel = new JLabel("All tests passed on the server.");

    Font font = yayLabel.getFont();
    font = font.deriveFont(Font.BOLD, font.getSize2D() * 1.2f);
    yayLabel.setFont(font);

    yayLabel.setForeground(new JBColor(new Color(0, 153, 51), new Color(0, 153, 51)));
    yayLabel.setIcon(TmcIcons.SUCCESS);
    //URL imageUrl = new URL("/fi/helsinki/cs/tmc/intellij/smile.gif");
    //ImageIcon icon = new ImageIcon(getClass().getResource("/smiley.gif"));
    //yayLabel.setIcon(icon);
    //new ImageIcon(getClass().getResource("/fi/helsinki/cs/tmc/smile.gif"));
    //yayLabel.setIcon(ConvenientDialogDisplayer.getDefault().getSmileyIcon());

    getContentPane().add(leftAligned(yayLabel));
}
 
开发者ID:testmycode,项目名称:tmc-intellij,代码行数:19,代码来源:SuccessfulSubmissionDialog.java

示例13: customizeRendererText

import com.intellij.ui.JBColor; //导入依赖的package包/类
@Override
protected void customizeRendererText(ColoredTreeCellRenderer renderer) {
  final StringBuilder buffer = new StringBuilder(128);
  final PsiClass containingClass = myMethod.getContainingClass();
  if (containingClass != null) {
    buffer.append(ClassPresentationUtil.getNameForClass(containingClass, false));
    buffer.append('.');
  }
  final String methodText = PsiFormatUtil.formatMethod(
    myMethod,
    PsiSubstitutor.EMPTY, PsiFormatUtil.SHOW_NAME | PsiFormatUtil.SHOW_PARAMETERS,
    PsiFormatUtil.SHOW_TYPE
  );
  buffer.append(methodText);

  final SimpleTextAttributes attributes = isEnabled() ?
                                          new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, UIUtil.getTreeForeground()) :
                                          SimpleTextAttributes.EXCLUDED_ATTRIBUTES;
  renderer.append(buffer.toString(), attributes);

  if (containingClass != null) {
    final String packageName = getPackageName(containingClass);
    renderer.append("  (" + packageName + ")", new SimpleTextAttributes(SimpleTextAttributes.STYLE_ITALIC, JBColor.GRAY));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:JavaMethodNode.java

示例14: configControls

import com.intellij.ui.JBColor; //导入依赖的package包/类
private static void configControls(String optionName,
                                   int value,
                                   boolean highlight,
                                   JLabel sizeLabel,
                                   JTextField sizeField,
                                   JLabel unitsLabel,
                                   JLabel currentValueLabel) {
  sizeLabel.setText(optionName);

  String formatted = value == -1 ? DiagnosticBundle.message("diagnostic.out.of.memory.currentValue.unknown") : String.valueOf(value);
  sizeField.setText(formatted);
  currentValueLabel.setText(DiagnosticBundle.message("diagnostic.out.of.memory.currentValue", formatted));

  if (highlight) {
    sizeLabel.setForeground(JBColor.RED);
    sizeField.setForeground(JBColor.RED);
    unitsLabel.setForeground(JBColor.RED);
    currentValueLabel.setForeground(JBColor.RED);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:OutOfMemoryDialog.java

示例15: ChooseDeviceDefinitionStep

import com.intellij.ui.JBColor; //导入依赖的package包/类
public ChooseDeviceDefinitionStep(@Nullable Disposable parentDisposable) {
  super(parentDisposable);
  setBodyComponent(myPanel);
  myDeviceDefinitionList.addSelectionListener(new DeviceDefinitionList.DeviceDefinitionSelectionListener() {
    @Override
    public void onDeviceSelectionChanged(@Nullable Device selectedDevice) {
      myDeviceDefinitionPreview.setDevice(selectedDevice);
      myState.put(DEVICE_DEFINITION_KEY, selectedDevice);
      updateEditButton(selectedDevice);
    }
  });
  myDeviceDefinitionList.addCategoryListener(myDeviceDefinitionPreview);
  myEditButtonContainer.setBackground(JBColor.background());
  myEditDeviceButton.setBackground(JBColor.background());
  myDeviceDefinitionList.setBorder(BorderFactory.createLineBorder(JBColor.lightGray));
  updateEditButton(null);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:ChooseDeviceDefinitionStep.java


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