Hi,
I've got a view "Views", which extend JScrollPane. My Processing application does the same:
But my MenuBar, as I open a Menu with several menu items gets hidden behind the jscrollpane :-/
regards,
johannes
I've got a view "Views", which extend JScrollPane. My Processing application does the same:
- **
* <h1>SunburstView</h1>
* <p>Main sunburst class.</p>
*
* @author Johannes Lichtenberger, University of Konstanz
*
*/
public final class SunburstView extends JScrollPane implements IView {
/** {@link SunburstGUI} which represents the GUI interface of the Sunburst view. */
private SunburstGUI mGUI;
/** {@link ViewNotifier} to notify views of changes. */
private final ViewNotifier mNotifier;
/** {@link ReadDB} instance to interact with Treetank. */
private transient ReadDB mDB;
/** Processing {@link PApplet} reference. */
private transient PApplet mEmbed;
/**
* Constructor.
*
* @param paramNotifier
* {@link ViewNotifier} instance.
*/
public SunburstView(final ViewNotifier paramNotifier) {
mNotifier = paramNotifier;
// Add view to notifier.
mNotifier.add(this);
}
@Override
public boolean isVisible() {
return GUIProp.EShowViews.SHOWSUNBURST.getValue();
}
@Override
public void refreshInit() {
mDB = mNotifier.getGUI().getReadDB();
mEmbed = new Embedded();
setViewportView(mEmbed);
}
@Override
public void refreshUpdate() {
/*
* Important to call this whenever embedding a PApplet.
* It ensures that the animation thread is started and
* that other internal variables are properly set.
*/
mEmbed.init();
}
@Override
public void dispose() { }
/** Embedded processing view. */
private final class Embedded extends PApplet {
@Override
public void setup() {
final SunburstController<SunburstModel, SunburstGUI> controller =
new SunburstController<SunburstModel, SunburstGUI>();
mGUI = SunburstGUI.createGUI(this, controller);
final SunburstModel model = new SunburstModel(this, mDB, controller);
model.traverseTree();
controller.addView(mGUI);
controller.addModel(model);
frame.setTitle("press 'o' to select an input folder!");
mGUI.setupGUI();
// Prevent thread from starving everything else.
noLoop();
}
...
- final SunburstView sunburstView = new SunburstView(mNotifier);
sunburstView.setPreferredSize(new Dimension(WIDTH, HEIGHT));
top.add(sunburstView, BorderLayout.CENTER);
getContentPane().add(top);
But my MenuBar, as I open a Menu with several menu items gets hidden behind the jscrollpane :-/
regards,
johannes
1