2024-07-02 19:13:30 +00:00
|
|
|
|
package OurApplication;
|
2024-06-15 19:55:30 +00:00
|
|
|
|
|
2024-07-02 19:13:30 +00:00
|
|
|
|
import visualisation.LegendArea;
|
|
|
|
|
|
|
|
|
|
import javax.swing.*;
|
|
|
|
|
import java.awt.*;
|
2024-06-15 19:55:30 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This class represents a visualization.LegendArea implementation and has been created for demonstration purposes only.
|
|
|
|
|
* Method initialize(Graphics) is overridden and now implements logic for drawing parameters on the legend area.
|
2024-07-02 19:13:30 +00:00
|
|
|
|
* @author MSch<EFBFBD>fer
|
2024-06-15 19:55:30 +00:00
|
|
|
|
* DHBW Stuttgart/Campus Horb AI2008<br>
|
|
|
|
|
* <br>
|
|
|
|
|
*/
|
2024-07-02 19:13:30 +00:00
|
|
|
|
public class OurLegendArea extends LegendArea{
|
2024-06-15 19:55:30 +00:00
|
|
|
|
|
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Standard constructor
|
|
|
|
|
*/
|
2024-07-02 19:13:30 +00:00
|
|
|
|
public OurLegendArea(){
|
2024-06-15 19:55:30 +00:00
|
|
|
|
super();
|
|
|
|
|
|
|
|
|
|
//set the legend area's preferred size manually for best visualization
|
|
|
|
|
setPreferredSize(new Dimension(150, 170));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Overridden method from super class.
|
|
|
|
|
* Draws all elements and descriptions on the LegendArea
|
|
|
|
|
* @param g the Graphics object of the corresponding panel
|
|
|
|
|
*/
|
|
|
|
|
public void initialize(Graphics g){
|
|
|
|
|
|
|
|
|
|
//Create a new TitledBorder for the LegendArea
|
|
|
|
|
setBorder(BorderFactory.createTitledBorder("LegendArea"));
|
|
|
|
|
}
|
|
|
|
|
}
|