33 lines
902 B
Java
33 lines
902 B
Java
package DifferentRollers;
|
|
|
|
import java.awt.*;
|
|
|
|
public class DrawingRollersCross implements IDifferentRollers{
|
|
private RollersCount rollersCount;
|
|
@Override
|
|
public void setRollersCount(int numOfRoller){
|
|
for (RollersCount numofenum : RollersCount.values()){
|
|
if (numofenum.getNumOfRollers() == numOfRoller){
|
|
rollersCount = numofenum;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public RollersCount getRollersCount(){
|
|
return rollersCount;
|
|
}
|
|
|
|
@Override
|
|
public void DrawRollers(Graphics2D g, int x, int y, int width, int height, Color bodyColor){
|
|
g.setColor(bodyColor);
|
|
g.fillOval(x, y, width, height);
|
|
g.setColor(Color.BLACK);
|
|
g.drawLine(x+2, y+2, x+6, y+6);
|
|
g.drawLine(x+2, y+6, x+6, y+2);
|
|
g.drawOval(x, y, width, height);
|
|
g.setColor(bodyColor);
|
|
}
|
|
}
|