com.sprhibrad.generator.ShrgList Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sprhibrad-generator Show documentation
Show all versions of sprhibrad-generator Show documentation
The generator of the SprHibRAD suite - Stefano Pizzocaro - 62
The newest version!
/*
Copyright (c) 2017, Stefano Pizzocaro. All rights reserved. Use is subject to license terms.
This file is part of SprHibRAD 1.0.
SprHibRAD 1.0 is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
SprHibRAD 1.0 is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with SprHibRAD 1.0. If not, see .
*/
package com.sprhibrad.generator;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.Vector;
import java.util.function.BiConsumer;
import javax.swing.ButtonGroup;
import javax.swing.DefaultListModel;
import javax.swing.DefaultListSelectionModel;
import javax.swing.JList;
import javax.swing.JScrollPane;
import javax.swing.ListSelectionModel;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import org.json.simple.JSONObject;
import com.sprhibrad.generator.SprHibRadGen.ListTarget;
/**
* The most important gui object that hosts either a list of tools available to
* be pushed on the project structure lists, or, right the latters, a container
* that enumerates something specific to the project being designed; in this
* case the order in which the items are listed may have crucial impact on the
* resulting project or no impact: the list will be associated with a JSONArray
* or a JSONObject respectively.
*/
public class ShrgList extends JScrollPane {
interface Projection {
void project(String key, JSONObject obj);
void clear();
}
private ActionPerformer actionPerformer;
public void setActionPerformer(ActionPerformer actionPerformer) {
this.actionPerformer = actionPerformer;
}
JList list;
protected DefaultListModel