本文整理汇总了Java中org.eclipse.draw2d.Border类的典型用法代码示例。如果您正苦于以下问题:Java Border类的具体用法?Java Border怎么用?Java Border使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Border类属于org.eclipse.draw2d包,在下文中一共展示了Border类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createFigure
import org.eclipse.draw2d.Border; //导入依赖的package包/类
@Override
protected IFigure createFigure()
{
RectangleFigure figure = new RectangleFigure();
figure.setBackgroundColor(BACKGROUND_COLOR);
Color borderCol = Display.getCurrent().getSystemColor(SWT.COLOR_GRAY);
Border figureBorder = new LineBorder(borderCol, 2);
figure.setBorder(figureBorder);
figure.setOutline(false);
GridLayout layoutManager = new GridLayout();
// zero margin, in order to connect the dependent axes to the shared one
layoutManager.marginHeight = 0;
layoutManager.marginWidth = 0;
figure.setLayoutManager(layoutManager);
datasetsPane = new RectangleFigure();
datasetsPane.setOutline(false);
final SimpleLoweredBorder datasetBorder = new SimpleLoweredBorder(3);
datasetsPane.setBorder(datasetBorder);
GridLayout datasetsPaneLayout = new GridLayout();
datasetsPane.setLayoutManager(datasetsPaneLayout);
figure.add(datasetsPane);
arrowFigure = new ArrowFigure(false);
figure.add(arrowFigure);
axisNameLabel = new AxisNameFigure(this);
figure.add(axisNameLabel);
return figure;
}
示例2: createFigure
import org.eclipse.draw2d.Border; //导入依赖的package包/类
@Override
protected IFigure createFigure()
{
final RectangleFigure figure = new RectangleFigure();
figure.setOutline(false);
final Color borderCol = Display.getCurrent().getSystemColor(SWT.COLOR_GRAY);
final Border figureBorder = new LineBorder(borderCol, 2);
figure.setBorder(figureBorder);
figure.setLayoutManager(new GridLayout());
nameLabel = new DirectionalLabel(Activator.FONT_8);
final ChartPaneEditPart.AxisLandingPad pad =
(ChartPaneEditPart.AxisLandingPad) getModel();
nameLabel.setText(pad.pos == ChartPanePosition.MIN ? "Min Axis"
: "Max Axis");
figure.add(nameLabel);
figure.getLayoutManager().setConstraint(nameLabel, new GridData(
GridData.FILL, GridData.FILL, true, true));
return figure;
}
示例3: addRow
import org.eclipse.draw2d.Border; //导入依赖的package包/类
private void addRow(String name, String value, String tableStyle) {
final Border border = new MarginBorder(5);
final ToolbarLayout layout = new ToolbarLayout();
layout.setMinorAlignment(ToolbarLayout.ALIGN_TOPLEFT);
layout.setStretchMinorAxis(true);
final Label nameLabel = new Label();
final Label valueLabel = new Label();
nameLabel.setBorder(border);
nameLabel.setText(name);
nameLabel.setLabelAlignment(PositionConstants.LEFT);
nameLabel.setForegroundColor(foregroundColor);
add(nameLabel);
if (!DisplayMessages.getMessage("action.title.change.design.simple").equals(tableStyle)
&& !DisplayMessages.getMessage("action.title.change.design.frame").equals(tableStyle)) {
valueLabel.setBackgroundColor(ColorConstants.white);
valueLabel.setOpaque(true);
valueLabel.setForegroundColor(ColorConstants.black);
} else {
valueLabel.setOpaque(false);
valueLabel.setForegroundColor(foregroundColor);
}
valueLabel.setBorder(border);
valueLabel.setText(value);
valueLabel.setLabelAlignment(PositionConstants.LEFT);
add(valueLabel);
}
示例4: getConstraintFor
import org.eclipse.draw2d.Border; //导入依赖的package包/类
/**
* Generates a draw2d constraint object derived from the specified child
* EditPart using the provided Request. The returned constraint will be
* translated to the application's model later using
* {@link #translateToModelConstraint(Object)}.
*
* @param request
* the ChangeBoundsRequest
* @param child
* the child EditPart for which the constraint should be
* generated
* @return the draw2d constraint
*/
protected Object getConstraintFor( ChangeBoundsRequest request,
GraphicalEditPart child )
{
IFigure figure = child.getFigure( );
Rectangle rect = new PrecisionRectangle(figure.getBounds());
figure.translateToAbsolute(rect);
rect = request.getTransformedRectangle( rect );
figure.translateToRelative(rect);
rect.translate( getLayoutOrigin( ).getNegated( ) );
if (figure instanceof IOutsideBorder)
{
Border border = ((IOutsideBorder)figure).getOutsideBorder( );
if (border != null)
{
Insets insets = border.getInsets( figure );
rect.shrink( insets.right, insets.bottom );
}
}
return getConstraintFor( rect );
}
示例5: getFigureSize
import org.eclipse.draw2d.Border; //导入依赖的package包/类
private Dimension getFigureSize()
{
IFigure figure = getOwner( ).getFigure( );
Dimension dim = figure.getSize( );
if (figure instanceof IOutsideBorder)
{
Border border = ((IOutsideBorder)figure).getOutsideBorder( );
Insets insets = border.getInsets( figure );
if (PositionConstants.EAST == getResizeDirection())
{
dim.width = dim.width - insets.right - insets.left;
}
else if (PositionConstants.SOUTH == getResizeDirection())
{
dim.height = dim.height - insets.bottom - insets.top;
}
}
return dim;
}
示例6: addRow
import org.eclipse.draw2d.Border; //导入依赖的package包/类
private void addRow(final String name, final String value, final String tableStyle) {
final Border border = new MarginBorder(5);
final ToolbarLayout layout = new ToolbarLayout();
layout.setMinorAlignment(OrderedLayout.ALIGN_TOPLEFT);
layout.setStretchMinorAxis(true);
final Label nameLabel = new Label();
final Label valueLabel = new Label();
nameLabel.setBorder(border);
nameLabel.setText(name);
nameLabel.setLabelAlignment(PositionConstants.LEFT);
nameLabel.setForegroundColor(foregroundColor);
this.add(nameLabel);
if (!ResourceString.getResourceString("action.title.change.design.simple").equals(tableStyle) && !ResourceString.getResourceString("action.title.change.design.frame").equals(tableStyle)) {
valueLabel.setBackgroundColor(ColorConstants.white);
valueLabel.setOpaque(true);
valueLabel.setForegroundColor(ColorConstants.black);
} else {
valueLabel.setOpaque(false);
valueLabel.setForegroundColor(foregroundColor);
}
valueLabel.setBorder(border);
valueLabel.setText(value);
valueLabel.setLabelAlignment(PositionConstants.LEFT);
this.add(valueLabel);
}
示例7: addRow
import org.eclipse.draw2d.Border; //导入依赖的package包/类
private void addRow(String name, String value, String tableStyle) {
Border border = new MarginBorder(5);
ToolbarLayout layout = new ToolbarLayout();
layout.setMinorAlignment(ToolbarLayout.ALIGN_TOPLEFT);
layout.setStretchMinorAxis(true);
Label nameLabel = new Label();
Label valueLabel = new Label();
nameLabel.setBorder(border);
nameLabel.setText(name);
nameLabel.setLabelAlignment(PositionConstants.LEFT);
nameLabel.setForegroundColor(this.foregroundColor);
this.add(nameLabel);
if (!ResourceString.getResourceString(
"action.title.change.design.simple").equals(tableStyle)
&& !ResourceString.getResourceString(
"action.title.change.design.frame").equals(tableStyle)) {
valueLabel.setBackgroundColor(ColorConstants.white);
valueLabel.setOpaque(true);
valueLabel.setForegroundColor(ColorConstants.black);
} else {
valueLabel.setOpaque(false);
valueLabel.setForegroundColor(this.foregroundColor);
}
valueLabel.setBorder(border);
valueLabel.setText(value);
valueLabel.setLabelAlignment(PositionConstants.LEFT);
this.add(valueLabel);
}
示例8: setBorder
import org.eclipse.draw2d.Border; //导入依赖的package包/类
@Override
public void setBorder(Border border) {
if (border != null){
Assert.isTrue(border instanceof TitaniumBackgroundBorder,
"Only TitaniumBackgroundBorder can be set in TitaniumFigure!");
}
super.setBorder(border);
}
示例9: setBorder
import org.eclipse.draw2d.Border; //导入依赖的package包/类
/**
* Overridden to assert that only {@link FlowBorder} is used.
* <code>null</code> is still a valid value as well.
*
* @param border
* <code>null</code> or a FlowBorder
*/
public void setBorder(Border border) {
if (border == null || border instanceof FlowBorder)
super.setBorder(border);
else
throw new RuntimeException(
"Border must be an instance of FlowBorder"); //$NON-NLS-1$
}
示例10: createBorder
import org.eclipse.draw2d.Border; //导入依赖的package包/类
@Override
protected Border createBorder() {
MarginBorder marginBorder = new MarginBorder(PADDING - 1);
LineBorder lineBorder = new LineBorder(1);
lineBorder.setColor(ColorConstants.black);
return new CompoundBorder(lineBorder, marginBorder);
}
示例11: fillShape
import org.eclipse.draw2d.Border; //导入依赖的package包/类
protected void fillShape( Graphics graphics )
{
Rectangle bounds = getBounds( ).getCopy( );
Border border = getBorder( );
if ( border != null )
{
bounds = bounds.crop( border.getInsets( null ) );
}
if ( isOpaque( ) )
graphics.fillRectangle( bounds );
}
示例12: outlineShape
import org.eclipse.draw2d.Border; //导入依赖的package包/类
protected void outlineShape( Graphics graphics )
{
Rectangle bounds = getBounds( ).getCopy( );
Border border = getBorder( );
if ( border != null )
{
bounds = bounds.crop( border.getInsets( null ) );
}
graphics.drawRectangle( bounds.x,
bounds.y,
bounds.width - 1,
bounds.height - 1 );
}
示例13: setBorder
import org.eclipse.draw2d.Border; //导入依赖的package包/类
@Override
public void setBorder(Border border) {
super.setBorder(border);
if(border != null)
setSize(border.getPreferredSize(this));
}
示例14: setBorder
import org.eclipse.draw2d.Border; //导入依赖的package包/类
@Override
public void setBorder(Border border) {
getContentsPane().setBorder(border);
}
示例15: setBorder
import org.eclipse.draw2d.Border; //导入依赖的package包/类
/**
* @see org.eclipse.draw2d.Figure#setBorder(org.eclipse.draw2d.Border)
*/
@Override
public void setBorder(Border border) {
}