Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
EXO2_TP3_ALGO
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AREZKI Celia
EXO2_TP3_ALGO
Commits
1f421f65
Commit
1f421f65
authored
9 months ago
by
AREZKI Celia
Browse files
Options
Downloads
Patches
Plain Diff
i changed App class because i cant have the same draw as the td so i changed it
parent
3c147b0f
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/shape/App.java
+16
-8
16 additions, 8 deletions
src/main/java/shape/App.java
with
16 additions
and
8 deletions
src/main/java/shape/App.java
+
16
−
8
View file @
1f421f65
...
@@ -7,11 +7,8 @@ import javafx.scene.Scene;
...
@@ -7,11 +7,8 @@ import javafx.scene.Scene;
import
javafx.scene.canvas.Canvas
;
import
javafx.scene.canvas.Canvas
;
import
javafx.scene.canvas.GraphicsContext
;
import
javafx.scene.canvas.GraphicsContext
;
import
javafx.scene.paint.Color
;
import
javafx.scene.paint.Color
;
import
javafx.scene.paint.Paint
;
import
javafx.stage.Stage
;
import
javafx.stage.Stage
;
public
class
App
extends
Application
{
public
class
App
extends
Application
{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
...
@@ -21,13 +18,24 @@ public class App extends Application {
...
@@ -21,13 +18,24 @@ public class App extends Application {
@Override
@Override
public
void
start
(
Stage
primaryStage
)
{
public
void
start
(
Stage
primaryStage
)
{
Group
root
=
new
Group
();
Group
root
=
new
Group
();
Canvas
canvas
=
new
Canvas
(
1
30
,
11
0
);
Canvas
canvas
=
new
Canvas
(
3
0
0
,
30
0
);
GraphicsContext
graphicsContext
=
canvas
.
getGraphicsContext2D
();
GraphicsContext
graphicsContext
=
canvas
.
getGraphicsContext2D
();
ShapeContainer
shapeContainer
=
new
ShapeContainer
();
ShapeContainer
shapeContainer
=
new
ShapeContainer
();
graphicsContext
.
setFill
(
Color
.
AQUAMARINE
);
graphicsContext
.
fillOval
(
10
,
10
,
10
,
10
);
Shape
rect
=
new
Rectangle
(
Color
.
GRAY
,
new
Point2D
(
150
,
150
),
new
Point2D
(
250
,
250
));
shapeContainer
.
addShape
(
new
Rectangle
(
Color
.
BLUE
,
new
Point2D
(
10
,
10
),
new
Point2D
(
40
,
40
)));
Shape
decoratedRect
=
new
BorderDecorator
(
new
CenterDecorator
(
rect
,
5
,
Color
.
RED
),
5
,
Color
.
BLUE
);
shapeContainer
.
addShape
(
decoratedRect
);
Shape
triangle
=
new
Polygon
(
Color
.
GRAY
,
new
Point2D
(
100
,
50
),
new
Point2D
(
150
,
150
),
new
Point2D
(
50
,
150
));
Shape
decoratedTriangle
=
new
BorderDecorator
(
new
CenterDecorator
(
triangle
,
5
,
Color
.
RED
),
5
,
Color
.
BLUE
);
shapeContainer
.
addShape
(
decoratedTriangle
);
shapeContainer
.
draw
(
graphicsContext
);
shapeContainer
.
draw
(
graphicsContext
);
root
.
getChildren
().
add
(
canvas
);
root
.
getChildren
().
add
(
canvas
);
primaryStage
.
setScene
(
new
Scene
(
root
));
primaryStage
.
setScene
(
new
Scene
(
root
));
primaryStage
.
show
();
primaryStage
.
show
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment