|
@@ -14,22 +14,25 @@ import animation.PseudoCodeNode;
|
|
|
|
|
|
public class PseudoCodeRenderer extends DefaultTreeCellRenderer {
|
|
public class PseudoCodeRenderer extends DefaultTreeCellRenderer {
|
|
|
|
|
|
- /**
|
|
|
|
- *
|
|
|
|
- */
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
+ private static ImageIcon currentLine = new ImageIcon( PseudoCodeNode.class.getResource( "/img/current_line.png" ) );
|
|
|
|
|
|
boolean specialColor = false;
|
|
boolean specialColor = false;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public Color getBackgroundNonSelectionColor() {
|
|
public Color getBackgroundNonSelectionColor() {
|
|
if(specialColor) {
|
|
if(specialColor) {
|
|
- return Color.GREEN;
|
|
|
|
|
|
+ return new Color( 0x464646 );
|
|
} else {
|
|
} else {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public Color getTextNonSelectionColor() {
|
|
|
|
+ return new Color( 0xb5c4cf );
|
|
|
|
+ }
|
|
|
|
+
|
|
private int countChildren( TreeNode treeNode )
|
|
private int countChildren( TreeNode treeNode )
|
|
{
|
|
{
|
|
if( treeNode.isLeaf() )
|
|
if( treeNode.isLeaf() )
|
|
@@ -64,15 +67,21 @@ public class PseudoCodeRenderer extends DefaultTreeCellRenderer {
|
|
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean arg2, boolean arg3, boolean arg4, int arg5, boolean arg6) {
|
|
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean arg2, boolean arg3, boolean arg4, int arg5, boolean arg6) {
|
|
|
|
|
|
PseudoCodeNode node = (PseudoCodeNode) value;
|
|
PseudoCodeNode node = (PseudoCodeNode) value;
|
|
- BufferedImage rowNumerImg = new BufferedImage( 30, 30, BufferedImage.TYPE_INT_ARGB );
|
|
|
|
|
|
+ BufferedImage rowNumerImg = new BufferedImage( 50, 30, BufferedImage.TYPE_INT_ARGB );
|
|
Graphics2D g = (Graphics2D) rowNumerImg.getGraphics();
|
|
Graphics2D g = (Graphics2D) rowNumerImg.getGraphics();
|
|
|
|
+ if( !node.hasSelectedSubnode() && node.isSelected() )
|
|
|
|
+ {
|
|
|
|
+ g.drawImage( currentLine.getImage(), 2, 5, 20, 20, null );
|
|
|
|
+ }
|
|
if( node.hasBreakPoint() )
|
|
if( node.hasBreakPoint() )
|
|
{
|
|
{
|
|
g.setColor( Color.RED );
|
|
g.setColor( Color.RED );
|
|
- g.fillOval(20, 10, 10, 10 );
|
|
|
|
|
|
+ g.fillOval( 40, 10, 10, 10 );
|
|
|
|
+ g.setColor( Color.WHITE );
|
|
|
|
+ g.drawOval( 40, 10, 10, 10 );
|
|
}
|
|
}
|
|
- g.setColor( Color.BLACK );
|
|
|
|
- g.drawString( "" + getLineNumber( (TreeNode) value ), 5, 20 );
|
|
|
|
|
|
+ g.setColor( new Color( 0xb5c4cf ) );
|
|
|
|
+ g.drawString( "" + getLineNumber( (TreeNode) value ), 25, 20 );
|
|
g.dispose();
|
|
g.dispose();
|
|
this.setClosedIcon( new ImageIcon( rowNumerImg ) );
|
|
this.setClosedIcon( new ImageIcon( rowNumerImg ) );
|
|
this.setOpenIcon( new ImageIcon( rowNumerImg ) );
|
|
this.setOpenIcon( new ImageIcon( rowNumerImg ) );
|