Java Code Examples for org.eclipse.draw2d.LineBorder#setColor()

The following examples show how to use org.eclipse.draw2d.LineBorder#setColor() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RowHandle.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Initializes the handle. Sets the {@link DragTracker}and DragCursor.
 */
protected void initialize( )
{
	setOpaque( true );
	LineBorder bd = new LineBorder( 1 );
	bd.setColor( ReportColorConstants.HandleBorderColor );
	setBorder( bd );

	String tp = getTooltipText( );
	if ( tp != null )
	{
		Label tooltip = new Label( tp );
		tooltip.setBorder( new MarginBorder( 0, 2, 0, 2 ) );
		setToolTip( tooltip );
	}

	setCursor( Cursors.ARROW );
}
 
Example 2
Source File: PackageMapDiagram.java    From JDeodorant with MIT License 5 votes vote down vote up
public PMClassFigure createSmellyClass(PMClassFigure classFigure, String key){
	List<CandidateRefactoring> candidates = keyMap.get(key);
	classFigure.setCandidates(candidates);
	int severity = candidates.size();
	Color color = calculateSeverityColor(severity);

	LineBorder border= (LineBorder)classFigure.getBorder();
	//classFigure.setToolTip(null);
	classFigure.setOriginalBackgroundColor(color);
	border.setColor(classFigure.getBackgroundColor());
	classFigure.setOriginalBorder(border);
	new SmellyClassMouseListener(this, classFigure);
	return classFigure;
}
 
Example 3
Source File: PackageFigure.java    From JDeodorant with MIT License 5 votes vote down vote up
public PackageFigure(String name, double scale){
	this.name= name;

	setLayoutManager(new ProportionalFlowLayout(scale,5, 10));
	setToolTip(new Label(name));
	LineBorder border = new LineBorder();
	border.setColor(ColorConstants.white);
	
	setBorder(new CompoundBorder(border, new MarginBorder(10, 5, 10, 5)));

}
 
Example 4
Source File: TableHFHandle.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Initializes the handle. Sets the {@link DragTracker}and DragCursor.
 */
protected void initialize( )
{
	//should draw the fill rectangle
	setOpaque( true );
	//draw the border line width is 1
	LineBorder bd = new LineBorder( 1 );
	bd.setColor( ReportColorConstants.HandleBorderColor );
	setBorder( bd );

	//set the default cursor, may not be a SIZEALL cursor()
	setCursor( Cursors.ARROW );

	initChildrenHandle( );
}
 
Example 5
Source File: ColumnHandle.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Initializes the handle. Sets the {@link DragTracker}and DragCursor.
 */
protected void initialize( )
{
	setOpaque( true );
	LineBorder bd = new LineBorder( 1 );
	bd.setColor( ReportColorConstants.HandleBorderColor );
	setBorder( bd );
	setCursor( Cursors.ARROW );
}
 
Example 6
Source File: CornerHandle.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Initializes the handle. Sets the {@link DragTracker}and DragCursor.
 */
protected void initialize( )
{
	setOpaque( true );
	LineBorder bd = new LineBorder( 1 );
	bd.setColor( ReportColorConstants.HandleBorderColor );
	setBorder( bd );
	setCursor( Cursors.ARROW );
}
 
Example 7
Source File: SmellyClassMouseListener.java    From JDeodorant with MIT License 4 votes vote down vote up
public void mousePressed(MouseEvent me) {
	if(classFigure.isSelected()){
		classFigure.setSelected(false);

		classFigure.setToOriginalState();
	}
	else{
		classFigure.setSelected(true);

		classFigure.setBackgroundColor(classFigure.getOriginalColor());
		classFigure.setBorder(new LineBorder(4));
		classFigure.setToolTip(null);
	}

	List<PMClassFigure> classFigures = diagram.getAllClassFigures();
	List<CandidateRefactoring> candidates = classFigure.getCandidates();


	for(PMClassFigure figure: classFigures){

		//clearing previous decoration
		if(!figure.equals(classFigure)){
			if(figure.isSelected())
				figure.setSelected(false);


			figure.setToOriginalState();
		}

		if(!candidates.isEmpty() && candidates.get(0) instanceof MoveMethodCandidateRefactoring){


			//finding and decorating target classes
			for(CandidateRefactoring candidate: candidates){
				MoveMethodCandidateRefactoring moveCandidate = (MoveMethodCandidateRefactoring) candidate;
				String name = moveCandidate.getTarget();

				if(figure.getName().equals(name)){
					if (classFigure.isSelected()){
						figure.setBackgroundColor(ColorConstants.black);

						if(!figure.isInnerClass()){
							LineBorder border = new LineBorder();
							border.setColor(ColorConstants.black);
							figure.setBorder(border);
						}

					}

				}

			} 
		}

	}
}