projetoBand.setResizePolicies((List) Arrays.asList(
new CoreRibbonResizePolicies.None(projetoBand.getControlPanel()),
new CoreRibbonResizePolicies.None(projetoBand.getControlPanel()),
new CoreRibbonResizePolicies.None(projetoBand.getControlPanel()),
new IconRibbonBandResizePolicy(projetoBand.getControlPanel())));
btnNovoProjeto = new JCommandButton(null, getResizableIconFromResource("new.png"));
btnNovoProjeto.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
novoProjeto();
}
});
btnAbrirProjeto = new JCommandButton(null, getResizableIconFromResource("open.png"));
btnAbrirProjeto.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
AbreProjetoPresenter abreProjeto = new AbreProjetoPresenter();
if (abreProjeto.getProjeto() != null) {
abreProjeto(abreProjeto.getProjeto());
}
}
});
btnFecharProjeto = new JCommandButton(null, getResizableIconFromResource("close.png"));
btnFecharProjeto.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
projeto = null;
state.fecharProjeto();
}
});
JCommandButton btnArvores = new JCommandButton(null, getResizableIconFromResource("arvores.png"));
projetoBand.addCommandButton(btnNovoProjeto, RibbonElementPriority.TOP);
projetoBand.addCommandButton(btnAbrirProjeto, RibbonElementPriority.TOP);
projetoBand.addCommandButton(btnFecharProjeto, RibbonElementPriority.TOP);
projetoBand.addCommandButton(btnArvores, RibbonElementPriority.TOP);
// Volume Band
JRibbonBand volumeBand = new JRibbonBand("Volume", getResizableIconFromResource("exit.png"));
volumeBand.setResizePolicies((List) Arrays.asList(
new CoreRibbonResizePolicies.None(projetoBand.getControlPanel()),
new CoreRibbonResizePolicies.None(projetoBand.getControlPanel()),
new IconRibbonBandResizePolicy(projetoBand.getControlPanel())));
btnVolumeNovoCenario = new JCommandButton(null, getResizableIconFromResource("newvolscenario.png"));
btnVolumeNovoCenario.setActionRichTooltip(new RichTooltip("Cenário", "Cria um novo cenário"));
btnVolumeNovoCenario.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
novoCenarioVolume();
}
});
btnVolumeDuplicarCenario = new JCommandButton(null, getResizableIconFromResource("dupCenarioVolume.png"));
btnVolumeDuplicarCenario.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
DuplicarCenarioPresenter dpCenario = new DuplicarCenarioPresenter(Main.this);
}
});
volumeBand.addCommandButton(btnVolumeNovoCenario, RibbonElementPriority.TOP);
volumeBand.addCommandButton(btnVolumeDuplicarCenario, RibbonElementPriority.TOP);
JRibbonBand indLocalBand = new JRibbonBand("Índice de Local", getResizableIconFromResource("exit.png"));
btnIndLocalNovoCenario = new JCommandButton(null, getResizableIconFromResource("newilscenario.png"));
btnIndLocalNovoCenario.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
iLocal++;
IconNode node = new IconNode("Cenário " + iLocal, true, new ImageIcon(Configuracao.getPath() + "images/cenario4.png"), IconNode.CENARIO_INDICELOCAL);
addNode("Índice de Local", node);
}
});
indLocalBand.addCommandButton(btnIndLocalNovoCenario, RibbonElementPriority.LOW);
indLocalBand.setPreferredSize(new Dimension(100, 100));
indLocalBand.setResizePolicies((List) Arrays.asList(
new CoreRibbonResizePolicies.None(projetoBand.getControlPanel()),
new IconRibbonBandResizePolicy(projetoBand.getControlPanel())));
JRibbonBand dadosBand = new JRibbonBand("world!", null);
dadosBand.setResizePolicies((List) Arrays.asList(new IconRibbonBandResizePolicy(dadosBand.getControlPanel())));
JRibbonBand configuracoesBand = new JRibbonBand("Configurações", null);
configuracoesBand.setResizePolicies((List) Arrays.asList(
new CoreRibbonResizePolicies.None(configuracoesBand.getControlPanel())));
JCommandButton btnConfiguracoes = new JCommandButton(null, getResizableIconFromResource("settings.png"));
btnConfiguracoes.setActionRichTooltip(new RichTooltip("Configurações", "Permite alterar as configurações do sistema"));
btnConfiguracoes.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
ConfiguracoesView configuracoes = new ConfiguracoesView(null, true);
configuracoes.setVisible(true);
}
});
configuracoesBand.addCommandButton(btnConfiguracoes, RibbonElementPriority.TOP);
JRibbonBand janelaBand = new JRibbonBand("Organizar", getResizableIconFromResource("exit.png"));
janelaBand.setResizePolicies((List) Arrays.asList(
new CoreRibbonResizePolicies.None(janelaBand.getControlPanel()),
new CoreRibbonResizePolicies.None(janelaBand.getControlPanel()),
new IconRibbonBandResizePolicy(janelaBand.getControlPanel())));
JCommandButton btnLadoALado = new JCommandButton(null, getResizableIconFromResource("tile_vertical.png"));
JCommandButton btnCascata = new JCommandButton(null, getResizableIconFromResource("cascade.png"));
btnLadoALado.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
desktop.tileFrames();
}
});
btnCascata.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
desktop.cascadeFrames();
}
});
janelaBand.addCommandButton(btnLadoALado, RibbonElementPriority.MEDIUM);
janelaBand.addCommandButton(btnCascata, RibbonElementPriority.MEDIUM);
JRibbonBand modeloBand = new JRibbonBand("Modelos", getResizableIconFromResource("models.png"));
modeloBand.setResizePolicies((List) Arrays.asList(
new CoreRibbonResizePolicies.None(janelaBand.getControlPanel()),
new IconRibbonBandResizePolicy(janelaBand.getControlPanel())));
JCommandButton btnManterModelos = new JCommandButton(null, getResizableIconFromResource("models.png"));
btnManterModelos.addActionListener(new ActionListener() {