本文整理汇总了Java中org.netbeans.api.visual.border.BorderFactory类的典型用法代码示例。如果您正苦于以下问题:Java BorderFactory类的具体用法?Java BorderFactory怎么用?Java BorderFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BorderFactory类属于org.netbeans.api.visual.border包,在下文中一共展示了BorderFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ListWidget
import org.netbeans.api.visual.border.BorderFactory; //导入依赖的package包/类
/**
* Creates a list widget.
* @param scene the scene
*/
public ListWidget (Scene scene) {
super (scene);
LookFeel lookFeel = scene.getLookFeel ();
setOpaque (true);
setBackground (lookFeel.getBackground ());
setBorder (BorderFactory.createLineBorder ());
setLayout (LayoutFactory.createVerticalFlowLayout ());
header = new Widget (scene);
header.setLayout (LayoutFactory.createHorizontalFlowLayout (LayoutFactory.SerialAlignment.CENTER, 0));
header.addChild (imageWidget = new ImageWidget (scene));
header.addChild (labelWidget = new LabelWidget (scene));
addChild (header);
addChild (new SeparatorWidget (scene, SeparatorWidget.Orientation.HORIZONTAL));
setState (ObjectState.createNormal ());
}
示例2: ListWidget
import org.netbeans.api.visual.border.BorderFactory; //导入依赖的package包/类
/**
* Creates a list widget.
* @param scene the scene
*/
public ListWidget (Scene scene) {
super (scene);
GeomUtil.LOG.warning ("org.netbeans.api.visual.widget.general.ListWidget class is deprecated. Use org.netbeans.modules.visual.experimental.widget.general.ListWidget class instead. Since it is an experimental class outside of public-API packages, you have to set an implementation dependency on the org.netbeans.api.visual module."); // NOI18N
LookFeel lookFeel = scene.getLookFeel ();
setOpaque (true);
setBackground (lookFeel.getBackground ());
setBorder (BorderFactory.createLineBorder ());
setLayout (LayoutFactory.createVerticalFlowLayout ());
header = new Widget (scene);
header.setLayout (LayoutFactory.createHorizontalFlowLayout (LayoutFactory.SerialAlignment.CENTER, 0));
header.addChild (imageWidget = new ImageWidget (scene));
header.addChild (labelWidget = new LabelWidget (scene));
addChild (header);
addChild (new SeparatorWidget (scene, SeparatorWidget.Orientation.HORIZONTAL));
setState (ObjectState.createNormal ());
}
示例3: testOffscreenRendering
import org.netbeans.api.visual.border.BorderFactory; //导入依赖的package包/类
public void testOffscreenRendering () {
Scene scene = new Scene ();
LayerWidget layer = new LayerWidget (scene);
layer.setPreferredBounds (new Rectangle (0, 0, 80, 80));
scene.addChild (layer);
LabelWidget widget = new LabelWidget (scene, "Hi");
widget.setVerticalAlignment (LabelWidget.VerticalAlignment.CENTER);
widget.setAlignment (LabelWidget.Alignment.CENTER);
widget.setBorder (BorderFactory.createLineBorder ());
widget.setPreferredLocation (new Point (20, 20));
widget.setPreferredBounds (new Rectangle (0, 0, 40, 40));
layer.addChild (widget);
BufferedImage image = dumpSceneOffscreenRendering (scene);
Color backgroundColor = (Color) (new DefaultLookFeel()).getBackground();
Color foregroundColor = (new DefaultLookFeel()).getForeground();
assertCleaness (testCleaness (image, backgroundColor, foregroundColor), image, null);
assertScene (scene, backgroundColor, new Rectangle (19, 19, 42, 42));
}
示例4: LogEventWidget
import org.netbeans.api.visual.border.BorderFactory; //导入依赖的package包/类
public LogEventWidget(LogCategoryWidget logAxisWidget, LogEvent logEvent) {
//super(logAxisWidget.getScene(), logAxisWidget.getEntity());
super(logAxisWidget.getScene());
this.setLabel(logEvent.getMessage());
this.setFont(getScene().getDefaultFont().deriveFont(height));
this.logAxisWidget = logAxisWidget;
this.logEvent = logEvent;
this.entity = logAxisWidget.getEntity();
this.setVerticalAlignment(valign);
this.setToolTipText(logEvent.getMessage());
this.setBorder(BorderFactory.createRoundedBorder(0, 0, this.entity.getColor(), Color.BLACK));
this.updateLocation();
}
示例5: GhostWidget
import org.netbeans.api.visual.border.BorderFactory; //导入依赖的package包/类
/**
* Create a new GhostWidget based on information about original widget
* @param original widget we will use info (headline, comment) from.
*/
GhostWidget(PoshWidget original) {
super(original.getPoshScene());
associatedWidget = original;
scene = original.getPoshScene();
headline = new LabelWidget(original.getPoshScene(),
original.getHeadlineText());
comment = new LabelWidget(original.getPoshScene(),
original.getCommentText());
headline.setFont(headlineFont);
comment.setFont(commentFont);
this.setBorder(BorderFactory.createRoundedBorder(15, 15, 4, 4, original.getType().getColor(), Color.DARK_GRAY));
this.setForeground(Color.BLACK);
this.setPreferredLocation(original.getLocation());
this.setMinimumSize(new Dimension(120, 10));
this.setLayout(LayoutFactory.createVerticalFlowLayout());
this.addChild(headline);
this.addChild(comment);
}
示例6: LoopClusterWidget
import org.netbeans.api.visual.border.BorderFactory; //导入依赖的package包/类
public LoopClusterWidget(CfgScene scene, int loopdepth, final int loopindex) {
super(scene);
this.cfgscene = scene;
this.loopIndex = loopindex;
this.loopDepth = loopdepth;
this.setBorder(BorderFactory.createDashedBorder(color, DASHSIZE, DASHSIZE/2, true));
this.getActions().addAction(ActionFactory.createEditAction( new EditProvider() { //double click action
public void edit(Widget w) {
if(w instanceof LoopClusterWidget){
for(LoopInfo info : cfgscene.getCfgEnv().getLoopMap().values()){
if(info.getLoopIndex() == loopindex){
cfgscene.setNodeSelection(info.getMembers());
break;
}
}
}
}
}));
}
示例7: notifyStateChanged
import org.netbeans.api.visual.border.BorderFactory; //导入依赖的package包/类
@Override
protected void notifyStateChanged(ObjectState previousState, ObjectState state) {
super.notifyStateChanged(previousState, state);
if (previousState.isHovered() != state.isHovered()) {
if (state.isHovered()) {
this.setBorder(BorderFactory.createLineBorder(1, HOVER_FOREGROUND_COLOR));
} else {
this.setBorder(BorderFactory.createLineBorder(1, NORMAL_FOREGROUND_COLOR));
}
}
if (previousState.isSelected() != state.isSelected()) {
if (state.isSelected()) {
this.setFont(boldFont);
} else {
this.setFont(font);
}
}
}
示例8: createSelectionWidget
import org.netbeans.api.visual.border.BorderFactory; //导入依赖的package包/类
@Override
public Widget createSelectionWidget() {
ContextPaletteManager palette = scene.getLookup().lookup(ContextPaletteManager.class);
if (palette != null) {
palette.cancelPalette();
}
Widget widget = new Widget(scene);
if (tool.equals(DesignerTools.SELECT)) {
widget.setBorder(BorderFactory.createLineBorder(1, Color.BLUE));
} else {
widget.setBorder(BorderFactory.createLineBorder(1, Color.BLACK));
}
return widget;
}
示例9: PNBColorScheme
import org.netbeans.api.visual.border.BorderFactory; //导入依赖的package包/类
private PNBColorScheme() {
COLOR_NORMAL = new Color(0xBACDF0);//new Color(160, 180, 210);
COLOR_HIGHLIGHTED = new Color(0x5B67B0);
COLOR60_SELECT = new Color(0xFF8500);
COLOR60_HOVER = new Color(0x5B67B0);
COLOR60_HOVER_BACKGROUND = new Color(0xB0C3E1);
COLOR1 = new Color(221, 235, 246);
COLOR2 = new Color(255, 255, 255);
COLOR3 = new Color(214, 235, 255);
COLOR4 = new Color(241, 249, 253);
COLOR5 = new Color(255, 255, 255);
BORDER60 = PFactory.createPNodeBorder(COLOR_NORMAL, 2, COLOR1, COLOR2, COLOR3, COLOR4, COLOR5);
BORDER60_SELECT = PFactory.createPNodeBorder(COLOR60_SELECT, 2, COLOR1, COLOR2, COLOR3, COLOR4, COLOR5);
BORDER60_HOVER = PFactory.createPNodeBorder(COLOR60_HOVER, 2, COLOR1, COLOR2, COLOR3, COLOR4, COLOR5);
BORDER60_PIN_SELECT = BorderFactory.createCompositeBorder(BorderFactory.createLineBorder(0, 1, 0, 1, COLOR60_SELECT), BorderFactory.createLineBorder(2, 7, 2, 7, COLOR60_SELECT));
BORDER_CATEGORY_BACKGROUND = new Color(0xCDDDF8);
BORDER_PIN = BorderFactory.createOpaqueBorder(2, 8, 2, 8);
}
示例10: POriginalColorScheme
import org.netbeans.api.visual.border.BorderFactory; //导入依赖的package包/类
private POriginalColorScheme() {
COLOR_NORMAL = new Color(0xBACDF0);
COLOR_HOVERED = Color.BLACK;
COLOR_SELECTED = new Color(0x748CC0);
COLOR_HIGHLIGHTED = new Color(0x316AC5);
COLOR1 = new Color(221, 235, 246);
COLOR2 = new Color(255, 255, 255);
COLOR3 = new Color(214, 235, 255);
COLOR4 = new Color(241, 249, 253);
COLOR5 = new Color(255, 255, 255);
BORDER_NODE = PFactory.createPNodeBorder(COLOR_NORMAL, 1, COLOR1, COLOR2, COLOR3, COLOR4, COLOR5);
BORDER_CATEGORY_BACKGROUND = new Color(0xCDDDF8);
BORDER_MINIMIZE = BorderFactory.createRoundedBorder(2, 2, null, COLOR_NORMAL);
BORDER_PIN = BorderFactory.createOpaqueBorder(2, 8, 2, 8);
BORDER_PIN_HOVERED = BorderFactory.createLineBorder(2, 8, 2, 8, Color.BLACK);
POINT_SHAPE_IMAGE = PointShapeFactory.createImagePointShape(ImageUtilities.loadImage("org/netbeans/modules/visual/resources/vmd-pin.png")); // NOI18N
}
示例11: TableCellSeparatorWidget
import org.netbeans.api.visual.border.BorderFactory; //导入依赖的package包/类
public TableCellSeparatorWidget(TableObjectScene scene, int index, Orientation orientation) {
super(scene, orientation);
this.index=index;
// We set a border to improve the sensible area....
if (Orientation.HORIZONTAL.equals(orientation))
{
setBorder(BorderFactory.createEmptyBorder(0, 3));
setCursor( Cursor.getPredefinedCursor( Cursor.S_RESIZE_CURSOR) );
}
else
{
setBorder(BorderFactory.createEmptyBorder(3, 0));
setCursor( Cursor.getPredefinedCursor( Cursor.W_RESIZE_CURSOR) );
}
setForeground(new Color(0,0,0,0));
updateBounds();
}
示例12: CellSeparatorWidget
import org.netbeans.api.visual.border.BorderFactory; //导入依赖的package包/类
public CellSeparatorWidget(CrosstabObjectScene scene, int index, Orientation orientation) {
super(scene, orientation);
this.index=index;
// We set a border to improve the sensible area....
if (Orientation.HORIZONTAL.equals(orientation))
{
setBorder(BorderFactory.createEmptyBorder(0, 3));
setCursor( Cursor.getPredefinedCursor( Cursor.S_RESIZE_CURSOR) );
}
else
{
setBorder(BorderFactory.createEmptyBorder(3, 0));
setCursor( Cursor.getPredefinedCursor( Cursor.W_RESIZE_CURSOR) );
}
setForeground(new Color(0,0,0,0));
updateBounds();
}
示例13: BandSeparatorWidget
import org.netbeans.api.visual.border.BorderFactory; //导入依赖的package包/类
public BandSeparatorWidget(ReportObjectScene scene, JRBand b) {
super(scene, Orientation.HORIZONTAL);
this.band=b;
// We set a border to improve the sensible area....
setBorder( BorderFactory.createEmptyBorder(0, 3) );
setCursor( Cursor.getPredefinedCursor( Cursor.S_RESIZE_CURSOR) );
setForeground(ReportObjectScene.DESIGN_LINE_COLOR);
// Add a listener to the band changes...
if (b instanceof JRDesignBand)
{
((JRDesignBand)b).getEventSupport().addPropertyChangeListener(this);
if (((JRDesignBand)b).getOrigin().getGroupName() != null)
{
String gname = ((JRDesignBand)b).getOrigin().getGroupName();
JRDesignGroup group = (JRDesignGroup) scene.getJasperDesign().getGroupsMap().get(gname);
if (group != null)
{
group.getEventSupport().addPropertyChangeListener(JRDesignGroup.PROPERTY_NAME , this );
}
}
}
updateBounds();
}
示例14: OpenSimObjectWidget
import org.netbeans.api.visual.border.BorderFactory; //导入依赖的package包/类
public OpenSimObjectWidget (Scene scene) {
super (scene);
setLayout (LayoutFactory.createVerticalFlowLayout ());
setBorder (BorderFactory.createLineBorder ());
setOpaque (true);
setCheckClipping (true);
Widget classWidget = new Widget (scene);
classWidget.setLayout (LayoutFactory.createHorizontalFlowLayout ());
classWidget.setBorder (BORDER_4);
ImageWidget classImage = new ImageWidget (scene);
classImage.setImage (IMAGE_CLASS);
classWidget.addChild (classImage);
className = new LabelWidget (scene);
className.setFont (scene.getDefaultFont ().deriveFont (Font.BOLD));
classWidget.addChild (className);
addChild (classWidget);
}
示例15: SchemaClassWidget
import org.netbeans.api.visual.border.BorderFactory; //导入依赖的package包/类
public SchemaClassWidget(Scene scene, SchemaClass mdClass)
{
super(scene);
attributesField = new JTextArea();
methodsField = new JTextArea();
setLayout(LayoutFactory.createVerticalFlowLayout());
setBorder(BorderFactory.createLineBorder());
LabelWidget nameLabel = createLabelCompartment(scene, mdClass.getXMLAttributeValue("name"), headerColor());
addChild(nameLabel);
refreshAttributes(mdClass);
refreshMethods(mdClass);
LabelWidget attributesLabel = createLabelCompartment(scene, "Attributes", Color.LIGHT_GRAY);
addChild(attributesLabel);
addChild(createTextCompartment(scene, buildAttributeString(mdClass), attributesField));
LabelWidget methodLabel = createLabelCompartment(scene, "Methods", Color.LIGHT_GRAY);
addChild(methodLabel);
addChild(createTextCompartment(scene, buildMethodString(mdClass) , methodsField));
getActions().addAction(ActionFactory.createMoveAction());
}