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


Java LayoutFactory类代码示例

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


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

示例1: ListWidget

import org.netbeans.api.visual.layout.LayoutFactory; //导入依赖的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 ());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:24,代码来源:ListWidget.java

示例2: select

import org.netbeans.api.visual.layout.LayoutFactory; //导入依赖的package包/类
public void select (Widget widget, Point localLocation, boolean invertSelection) {
        Widget currentActiveCard = LayoutFactory.getActiveCard (cardLayoutWidget);

        List<Widget> children = cardLayoutWidget.getChildren ();
        int i = children.indexOf (currentActiveCard);
        i ++;
        if (i >= children.size ())
            i = 0;
        Widget newActiveCard = children.get (i);

        if (currentActiveCard == newActiveCard)
            return;

        LayoutFactory.setActiveCard (cardLayoutWidget, newActiveCard);
//        notifyCardSwitched (currentActiveCard, newActiveCard);
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:SwitchCardProvider.java

示例3: calculateBestCenterAlignment

import org.netbeans.api.visual.layout.LayoutFactory; //导入依赖的package包/类
private LayoutFactory.ConnectionWidgetLayoutAlignment calculateBestCenterAlignment(Point point, Rectangle bounds) {
    LayoutFactory.ConnectionWidgetLayoutAlignment retVal = LayoutFactory.ConnectionWidgetLayoutAlignment.NONE;
    
    if(bounds != null) {
        if(point.x <= bounds.x) {
            retVal = LayoutFactory.ConnectionWidgetLayoutAlignment.CENTER_LEFT;
        } else if(point.x >= (bounds.x + bounds.width)) {
            retVal = LayoutFactory.ConnectionWidgetLayoutAlignment.CENTER_RIGHT;
        } else if(point.y <= bounds.y) {
            retVal = LayoutFactory.ConnectionWidgetLayoutAlignment.TOP_CENTER;
        } else if(point.y >= (bounds.y + bounds.height)) {
            retVal = LayoutFactory.ConnectionWidgetLayoutAlignment.BOTTOM_CENTER;
        }
    }
    
    return retVal;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:ConnectionWidgetLayout.java

示例4: VMDGraphScene

import org.netbeans.api.visual.layout.LayoutFactory; //导入依赖的package包/类
/**
 * Creates a VMD graph scene with a specific color scheme.
 * @param scheme the color scheme
 */
public VMDGraphScene (VMDColorScheme scheme) {
    this.scheme = scheme;
    setKeyEventProcessingType (EventProcessingType.FOCUSED_WIDGET_AND_ITS_PARENTS);

    addChild (backgroundLayer);
    addChild (mainLayer);
    addChild (connectionLayer);
    addChild (upperLayer);

    router = RouterFactory.createOrthogonalSearchRouter (mainLayer, connectionLayer);

    getActions ().addAction (ActionFactory.createZoomAction ());
    getActions ().addAction (ActionFactory.createPanAction ());
    getActions ().addAction (ActionFactory.createRectangularSelectAction (this, backgroundLayer));

    sceneLayout = LayoutFactory.createSceneGraphLayout (this, new GridGraphLayout<String, String> ().setChecker (true));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:VMDGraphScene.java

示例5: ListWidget

import org.netbeans.api.visual.layout.LayoutFactory; //导入依赖的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 ());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:ListWidget.java

示例6: IconNodeWidget

import org.netbeans.api.visual.layout.LayoutFactory; //导入依赖的package包/类
/**
 * Creates an icon node widget with a specified orientation.
 * @param scene the scene
 * @param orientation the text orientation
 */
public IconNodeWidget (Scene scene, TextOrientation orientation) {
    super (scene);
    LookFeel lookFeel = getScene ().getLookFeel ();

    switch (orientation) {
        case BOTTOM_CENTER:
            setLayout (LayoutFactory.createVerticalFlowLayout (LayoutFactory.SerialAlignment.CENTER, - lookFeel.getMargin () + 1));
            break;
        case RIGHT_CENTER:
            setLayout (LayoutFactory.createHorizontalFlowLayout (LayoutFactory.SerialAlignment.CENTER, - lookFeel.getMargin () + 1));
            break;
    }

    imageWidget = new ImageWidget (scene);
    addChild (imageWidget);

    labelWidget = new LabelWidget (scene);
    labelWidget.setFont (scene.getDefaultFont ().deriveFont (14.0f));
    addChild (labelWidget);

    setState (ObjectState.createNormal ());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:28,代码来源:IconNodeWidget.java

示例7: TLScene

import org.netbeans.api.visual.layout.LayoutFactory; //导入依赖的package包/类
public TLScene(TLDatabase db) {
        LayoutFactory.SerialAlignment ALIGNMENT = LayoutFactory.SerialAlignment.LEFT_TOP;
        Layout flowLayout = LayoutFactory.createVerticalFlowLayout(ALIGNMENT, 10);

        getActions().addAction(ActionFactory.createPanAction());

        // add main layer
        this.mainLayer = new LayerWidget(this);
        this.mainLayer.setLayout(flowLayout);
        this.addChild(mainLayer);

        // add overlay layer
        this.overlayLayer = new LayerWidget(this);
        this.addChild(overlayLayer);

        // add CurrentTimeWidget to over
//        currentTimeWidget = new CurrentTimeWidget(this, db);
//        overlayLayer.addChild(currentTimeWidget);

        // add widget showing ticks above
        ticsWidgety = new TimeTicsWidget(this);
        this.mainLayer.addChild(ticsWidgety);
    }
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:24,代码来源:TLScene.java

示例8: AxisWidget

import org.netbeans.api.visual.layout.LayoutFactory; //导入依赖的package包/类
AxisWidget(Scene scene, TLEntity entity, String text, int stripHeight, Border border) {
    super(scene, entity);

    this.setLayout(LayoutFactory.createAbsoluteLayout());

    this.stripHeight = stripHeight;

    this.nameWidget = new LabelWidget(scene, text);
    this.addChild(nameWidget);
    this.revalidate();
    this.updateNameLocation();

    this.stripWidget = new StripWidget(scene, entity, border);
    this.addChild(stripWidget);
    this.revalidate();
    this.updateStripRange();
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:18,代码来源:AxisWidget.java

示例9: EntityWidget

import org.netbeans.api.visual.layout.LayoutFactory; //导入依赖的package包/类
public EntityWidget(TLScene scene, TLEntity entity) {
    super(scene);

    this.entity = entity;

    setLayout(LayoutFactory.createVerticalFlowLayout());
    // create a strip widget
    this.stripWidget = new EntityAxisStrip(scene, entity);
    this.addChild(stripWidget);

    entity.addListener(updateEndTimeListener);
    entity.addListener(addLogRecorderListener);

    for (TLLogRecorder logRecorder : entity.getLogRecorders()) {
        this.addLogCategoryWidget(logRecorder);
    }
    scene.validate();
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:19,代码来源:EntityWidget.java

示例10: childElementRemoved

import org.netbeans.api.visual.layout.LayoutFactory; //导入依赖的package包/类
@Override
public void childElementRemoved(TRIGGER_OWNER triggerOwner, PoshElement child, int removedChildIndex) {
    if (isSense(child)) {
        // XXX: This is rather unpleasant hack, I should use custom layout or something. What I want is to have gap when trigger has at least one sense in it, but no gap, when there is not sense in the trigger.
        if (trigger.isEmpty()) {
            triggerEnvelope.getParentWidget().setLayout(LayoutFactory.createVerticalFlowLayout(LayoutFactory.SerialAlignment.LEFT_TOP, 0));
        }
        
        ShedSenseWidget removedSenseWidget = triggerEnvelope.getChild(removedChildIndex);
        triggerEnvelope.remove(removedSenseWidget);

        boolean triggerIsEmpty = (triggerEnvelope.numberOfChildren() == 0);
        boolean removedSenseWasLast = (removedChildIndex == triggerEnvelope.numberOfChildren());
        boolean triggerIsMissingArrow = (!triggerIsEmpty && !removedSenseWasLast);

        if (triggerIsMissingArrow) {
            Anchor sourceAnchor = getAnchorBeforePosition(removedChildIndex);
            Anchor targetAnchor = triggerEnvelope.getChild(removedChildIndex).getCommonAnchor();

            scene.addArrow(sourceAnchor, targetAnchor);
        }
        scene.update();
    }
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:25,代码来源:TriggerPresenter.java

示例11: GhostWidget

import org.netbeans.api.visual.layout.LayoutFactory; //导入依赖的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);
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:29,代码来源:GhostWidget.java

示例12: setSceneLayout

import org.netbeans.api.visual.layout.LayoutFactory; //导入依赖的package包/类
public void setSceneLayout(int newLayout) {

        GraphLayout<CfgNode, CfgEdge> graphLayout = null;

        switch (newLayout) {
            case CfgEditorContext.LAYOUT_HIERARCHICALNODELAYOUT:
                graphLayout = new HierarchicalNodeLayout(this);
                break;

            case CfgEditorContext.LAYOUT_HIERARCHICALCOMPOUNDLAYOUT:
                graphLayout = new HierarchicalCompoundLayout(this);
                break;
        }

        this.currentLayout = newLayout;
        if (graphLayout != null) {
            this.sceneLayout = LayoutFactory.createSceneGraphLayout(this, graphLayout);
        }
        
        getPreferences().putInt(PREFERENCE_LAYOUT, newLayout);
        sceneLayout.invokeLayoutImmediately();
    }
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:23,代码来源:CfgScene.java

示例13: ControlFlowScene

import org.netbeans.api.visual.layout.LayoutFactory; //导入依赖的package包/类
public ControlFlowScene() {
    selection = new HashSet<BlockWidget>();

    this.getInputBindings().setZoomActionModifiers(0);
    this.setLayout(LayoutFactory.createAbsoluteLayout());

    mainLayer = new LayerWidget(this);
    this.addChild(mainLayer);

    edgeLayer = new LayerWidget(this);
    this.addChild(edgeLayer);

    selectLayer = new LayerWidget(this);
    this.addChild(selectLayer);

    this.getActions().addAction(hoverAction);
    this.getActions().addAction(selectAction);
    this.getActions().addAction(ActionFactory.createRectangularSelectAction(this, selectLayer, this));
    this.getActions().addAction(ActionFactory.createMouseCenteredZoomAction(1.1));
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:21,代码来源:ControlFlowScene.java

示例14: LabelConnectionWidget

import org.netbeans.api.visual.layout.LayoutFactory; //导入依赖的package包/类
public LabelConnectionWidget(Scene scene, String name) {
            super(scene);
            this.scene = (IModelerScene) scene;
            labelWidget = new MultilineEditableCompartmentWidget(scene, name, null,
                    this, "getResourcePath()", name);
            labelWidget.setAlignment(LabelWidget.Alignment.CENTER);
            label = labelWidget;
            

            setLayout(LayoutFactory.createVerticalFlowLayout(LayoutFactory.SerialAlignment.CENTER, 1)); // use vertical layout

            setBorder(NON_SELECTED_BORDER);
//            labelWidget = (LabelWidget) label;
            addChild(label);
//            setLayout(LayoutFactory.createVerticalFlowLayout());

            initActions();
           

        }
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:21,代码来源:AbstractLabelManager.java

示例15: AbstractNodeWidget

import org.netbeans.api.visual.layout.LayoutFactory; //导入依赖的package包/类
/**
 * Creates an icon node widget with a specified orientation.
 *
 * @param scene the scene
 * @param orientation the text orientation
 * @param textDesign
 */
public AbstractNodeWidget(IModelerScene scene, TextOrientation orientation, ITextDesign textDesign) {
    super((Scene) scene);
    this.textDesign = textDesign;
    
    LookFeel lookFeel = getScene().getLookFeel();

    switch (orientation) {
        case BOTTOM_CENTER:
            setLayout(LayoutFactory.createVerticalFlowLayout(LayoutFactory.SerialAlignment.CENTER, -lookFeel.getMargin() + 1));
            break;
        case RIGHT_CENTER:
            setLayout(LayoutFactory.createHorizontalFlowLayout(LayoutFactory.SerialAlignment.CENTER, -lookFeel.getMargin() + 1));
            break;
    }

    setState(ObjectState.createNormal());

}
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:26,代码来源:AbstractNodeWidget.java


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