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


Java ColorDescriptor类代码示例

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


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

示例1: generatePushValue

import com.intellij.uiDesigner.lw.ColorDescriptor; //导入依赖的package包/类
public void generatePushValue(final GeneratorAdapter generator, final Object value) {
  ColorDescriptor descriptor = (ColorDescriptor) value;
  if (descriptor.getColor() != null) {
    generator.newInstance(ourColorType);
    generator.dup();
    generator.push(descriptor.getColor().getRGB());
    generator.invokeConstructor(ourColorType, ourInitMethod);
  }
  else if (descriptor.getSwingColor() != null) {
    generator.push(descriptor.getSwingColor());
    generator.invokeStatic(ourUIManagerType, ourGetColorMethod);
  }
  else if (descriptor.getSystemColor() != null) {
    generator.getStatic(ourSystemColorType, descriptor.getSystemColor(), ourSystemColorType);
  }
  else if (descriptor.getAWTColor() != null) {
    generator.getStatic(ourColorType, descriptor.getAWTColor(), ourColorType);
  }
  else if (descriptor.isColorSet()) {
    throw new IllegalStateException("Unknown color type");
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:ColorPropertyCodeGenerator.java

示例2: importSnapshotValue

import com.intellij.uiDesigner.lw.ColorDescriptor; //导入依赖的package包/类
@Override
public void importSnapshotValue(final SnapshotContext context, final JComponent component, final RadComponent radComponent) {
  try {
    if (component.getParent() != null) {
      Color componentColor = (Color) myReadMethod.invoke(component, EMPTY_OBJECT_ARRAY);
      Color parentColor = (Color) myReadMethod.invoke(component.getParent(), EMPTY_OBJECT_ARRAY);
      ColorDescriptor defaultColor = getDefaultValue(component);
      if (componentColor != null && !Comparing.equal(componentColor, parentColor) && !Comparing.equal(componentColor, defaultColor)) {
        setValue(radComponent, new ColorDescriptor(componentColor));
      }
    }
  }
  catch (Exception e) {
    // ignore
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:IntroColorProperty.java

示例3: writeColorDescriptor

import com.intellij.uiDesigner.lw.ColorDescriptor; //导入依赖的package包/类
public void writeColorDescriptor(final ColorDescriptor value) {
  Color color = value.getColor();
  if (color != null) {
    addAttribute(UIFormXmlConstants.ATTRIBUTE_COLOR, color.getRGB());
  }
  else if (value.getSwingColor() != null) {
    addAttribute(UIFormXmlConstants.ATTRIBUTE_SWING_COLOR, value.getSwingColor());
  }
  else if (value.getSystemColor() != null) {
    addAttribute(UIFormXmlConstants.ATTRIBUTE_SYSTEM_COLOR, value.getSystemColor());
  }
  else if (value.getAWTColor() != null) {
    addAttribute(UIFormXmlConstants.ATTRIBUTE_AWT_COLOR, value.getAWTColor());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:XmlWriter.java

示例4: setValueImpl

import com.intellij.uiDesigner.lw.ColorDescriptor; //导入依赖的package包/类
protected void setValueImpl(final RadContainer component, final ColorDescriptor value) throws Exception {
  if (myTitleColor) {
    component.setBorderTitleColor(value);
  }
  else {
    component.setBorderColor(value);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:BorderProperty.java

示例5: getRenderer

import com.intellij.uiDesigner.lw.ColorDescriptor; //导入依赖的package包/类
@NotNull
public PropertyRenderer<ColorDescriptor> getRenderer() {
  if (myRenderer == null) {
    myRenderer = new ColorRenderer();
  }
  return myRenderer;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:BorderProperty.java

示例6: getValue

import com.intellij.uiDesigner.lw.ColorDescriptor; //导入依赖的package包/类
@Override public ColorDescriptor getValue(final RadComponent component) {
  final ColorDescriptor colorDescriptor = (ColorDescriptor)component.getDelegee().getClientProperty(CLIENT_PROPERTY_KEY_PREFIX + getName());
  if (colorDescriptor == null) {
    return new ColorDescriptor((Color) invokeGetter(component));
  }
  return colorDescriptor;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:IntroColorProperty.java

示例7: prepareComponent

import com.intellij.uiDesigner.lw.ColorDescriptor; //导入依赖的package包/类
private void prepareComponent(final ColorDescriptor value, final boolean selected) {
  myColorDescriptor = value;
  clear();
  setIcon(UIDesignerIcons.Empty);
  setBackground(selected ? UIUtil.getTableSelectionBackground() : UIUtil.getTableBackground());
  if (myColorDescriptor != null) {
    append(myColorDescriptor.toString(),
           selected ? SimpleTextAttributes.SELECTED_SIMPLE_CELL_ATTRIBUTES : SimpleTextAttributes.SIMPLE_CELL_ATTRIBUTES);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:ColorRenderer.java

示例8: collectSwingColorDescriptors

import com.intellij.uiDesigner.lw.ColorDescriptor; //导入依赖的package包/类
private List<ColorDescriptor> collectSwingColorDescriptors() {
  ArrayList<ColorDescriptor> result = new ArrayList<ColorDescriptor>();
  UIDefaults defaults = UIManager.getDefaults();
  Enumeration e = defaults.keys ();
  while(e.hasMoreElements()) {
    Object key = e.nextElement();
    Object value = defaults.get(key);
    if (key instanceof String && value instanceof Color) {
      result.add(ColorDescriptor.fromSwingColor((String) key));
    }
  }
  return result;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:14,代码来源:ColorEditor.java

示例9: collectColorFields

import com.intellij.uiDesigner.lw.ColorDescriptor; //导入依赖的package包/类
private List<ColorDescriptor> collectColorFields(final Class aClass, final boolean isSystem) {
  ArrayList<ColorDescriptor> result = new ArrayList<ColorDescriptor>();
  Field[] colorFields = aClass.getDeclaredFields();
  for(Field field: colorFields) {
    if ((field.getModifiers() & Modifier.STATIC) != 0 &&
        Color.class.isAssignableFrom(field.getType()) &&
        Character.isLowerCase(field.getName().charAt(0))) {
      final ColorDescriptor color = isSystem
                                    ? ColorDescriptor.fromSystemColor(field.getName())
                                    : ColorDescriptor.fromAWTColor(field.getName());
      result.add(color);
    }
  }
  return result;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:16,代码来源:ColorEditor.java

示例10: getSelectedValue

import com.intellij.uiDesigner.lw.ColorDescriptor; //导入依赖的package包/类
public ColorDescriptor getSelectedValue() {
  final Color color = myColorChooser.getColor();
  if (color instanceof ColorDescriptorWrapper) {
    return ((ColorDescriptorWrapper) color).getDescriptor();
  }
  return new ColorDescriptor(color);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:8,代码来源:ColorEditor.java

示例11: MyDescriptorChooserPanel

import com.intellij.uiDesigner.lw.ColorDescriptor; //导入依赖的package包/类
public MyDescriptorChooserPanel(final String displayName, List<ColorDescriptor> colorDescriptorList) {
  myDisplayName = displayName;

  Collections.sort(colorDescriptorList, new Comparator<ColorDescriptor>() {
    public int compare(final ColorDescriptor o1, final ColorDescriptor o2) {
      return o1.toString().compareTo(o2.toString());
    }
  });

  myColorDescriptors = colorDescriptorList.toArray(new ColorDescriptor[colorDescriptorList.size()]);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:12,代码来源:ColorEditor.java

示例12: buildChooser

import com.intellij.uiDesigner.lw.ColorDescriptor; //导入依赖的package包/类
protected void buildChooser() {
  setLayout(new BorderLayout());
  myDescriptorList = new JBList(myColorDescriptors);
  myDescriptorList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
  myDescriptorList.setVisibleRowCount(15);
  myDescriptorList.setCellRenderer(new ColorRenderer());
  myDescriptorList.addListSelectionListener(new ListSelectionListener() {
    public void valueChanged(ListSelectionEvent e) {
      ColorDescriptor descriptor = (ColorDescriptor)myDescriptorList.getSelectedValue();
      getColorSelectionModel().setSelectedColor(new ColorDescriptorWrapper(descriptor));
    }
  });
  new ListSpeedSearch(myDescriptorList);
  add(ScrollPaneFactory.createScrollPane(myDescriptorList), BorderLayout.CENTER);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:16,代码来源:ColorEditor.java

示例13: getValue

import com.intellij.uiDesigner.lw.ColorDescriptor; //导入依赖的package包/类
public ColorDescriptor getValue(final RadContainer component) {
  return myTitleColor ? component.getBorderTitleColor() : component.getBorderColor();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:BorderProperty.java

示例14: write

import com.intellij.uiDesigner.lw.ColorDescriptor; //导入依赖的package包/类
public void write(@NotNull ColorDescriptor value, XmlWriter writer) {
  writer.writeColorDescriptor(value);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:IntroColorProperty.java

示例15: setValueImpl

import com.intellij.uiDesigner.lw.ColorDescriptor; //导入依赖的package包/类
@Override protected void setValueImpl(final RadComponent component, final ColorDescriptor value) throws Exception {
  component.getDelegee().putClientProperty(CLIENT_PROPERTY_KEY_PREFIX + getName(), value);
  if (value != null && value.isColorSet()) {
    invokeSetter(component, value.getResolvedColor());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:IntroColorProperty.java


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