Skip to content

Commit 4dfc117

Browse files
committed
Arreglos
1 parent 8e7cf0e commit 4dfc117

File tree

4 files changed

+25
-11
lines changed

4 files changed

+25
-11
lines changed

.classpath

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<classpath>
3-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
43
<classpathentry kind="src" path="Observer/src"/>
4+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
5+
<attributes>
6+
<attribute name="module" value="true"/>
7+
</attributes>
8+
</classpathentry>
59
<classpathentry kind="con" path="org.eclipse.ajdt.core.ASPECTJRT_CONTAINER"/>
10+
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/JavaFx15"/>
611
<classpathentry kind="output" path="bin"/>
712
</classpath>

Observer/src/.classpath

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<classpath>
3-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
4+
<attributes>
5+
<attribute name="module" value="true"/>
6+
</attributes>
7+
</classpathentry>
48
<classpathentry kind="src" path=""/>
9+
<classpathentry kind="lib" path="Aspecto.aj"/>
510
<classpathentry kind="output" path=""/>
611
</classpath>

Observer/src/Aspecto.aj

+2-4
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ public aspect Aspecto {
77

88
after(): operacion() {
99
Alert show = new Alert(Alert.AlertType.WARNING);
10-
11-
show.setTitle("TITULO DEL MENSAJE");
12-
10+
show.setTitle("Funcionalidad Adicional Realizada con exito");
1311
if(thisJoinPoint.getSignature().toString().equals("void operacion.sumar1()")) {
1412
show.setHeaderText("Realizo la operacion 1 ");
1513
show.setContentText("Su sumo 10 ");
@@ -28,7 +26,7 @@ public aspect Aspecto {
2826
after(): color() {
2927
Alert show = new Alert(Alert.AlertType.WARNING);
3028
show.setHeaderText("ÉXITO!!!!");
31-
show.setTitle("TITULO DEL MENSAJE");
29+
show.setTitle("Funcionalidad realizada con exito");
3230
Text arg = (Text) thisJoinPoint.getArgs()[1];
3331
if(thisJoinPoint.getSignature().toString().equals("void Main.color1(GridPane, Text)")) {
3432
arg.setText("Color 1: Rojo");

Observer/src/Main.java

+11-5
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,19 @@ public void start(Stage primaryStage) {
1616
Button btn1=new Button("Color 1");
1717
Button btn2=new Button("Color 2");
1818
Button btn3=new Button("Color 3");
19-
Text txt = new Text("");
19+
Text txt = new Text();
20+
Text txt2 = new Text("Suma de colores:"+"\n"+"Instrucciones: Conforme le da click a un boton correspondiente,"
21+
+ "\n"+" estos se sumaran constantemente."
22+
+"\n"+"Los valores son: "+"\n"+"Color 1: 10"+"\n"+"Color 2: 20"+"\n"+"Color 3: 30");
23+
Text txt3 = new Text("Resultado");
2024
HBox root=new HBox();
21-
customize(btn1,btn2,btn3,txt,root,gp);
22-
Scene scene= new Scene(gp,300,400);
25+
customize(btn1,btn2,btn3,txt,txt2,txt3,root,gp);
26+
Scene scene= new Scene(gp,400,500);
2327
primaryStage.setScene(scene);
2428
primaryStage.show();
2529
}
2630

27-
private void customize(Button btn1,Button btn2,Button btn3,Text txt, HBox root,GridPane gp) {
31+
private void customize(Button btn1,Button btn2,Button btn3,Text txt, Text txt2, Text txt3, HBox root,GridPane gp) {
2832
btn1.setOnAction(event -> {color1(gp, txt);
2933
o.sumar1();
3034
acuse.setText(o.getnumero()+"");
@@ -43,7 +47,9 @@ private void customize(Button btn1,Button btn2,Button btn3,Text txt, HBox root,G
4347
root.getChildren().addAll(btn1,btn2,btn3);
4448
gp.add(root, 0,0);
4549
gp.add(txt, 0, 1);
46-
gp.add(acuse,0,2);
50+
gp.add(txt2, 0, 2);
51+
gp.add(txt3,0,3);
52+
gp.add(acuse,0,4);
4753
}
4854

4955
public void color1(GridPane root,Text txt) {

0 commit comments

Comments
 (0)