Package gov.nasa.arc.mct.fastplot.view

Examples of gov.nasa.arc.mct.fastplot.view.LegendEntryPopupMenuFactory$LegendEntryPopup


 
  /**
   * Adds the popup menus to plot legend entry.
   */
  public void addPopupMenus() {
    LegendEntryPopupMenuFactory popupManager = new LegendEntryPopupMenuFactory(plotUser);
    for (int index = 0; index < subPlots.size(); index++) {
      AbstractPlottingPackage plot = subPlots.get(index);
      for (LegendEntry entry : plot.getLegendManager().getLegendEntryList()) {
        entry.setPopup(popupManager);
      }
View Full Code Here


  @Test
  public void testLegendEntryPopupMenuSize() {
    Mockito.when(mockPolicyManager.execute(Mockito.anyString(), Mockito.<PolicyContext> any()))
      .thenReturn(new ExecutionResult(null, false, null))
   
    LegendEntryPopupMenuFactory manager = new LegendEntryPopupMenuFactory(mockPlotViewManifestation);
    JPopupMenu menu = getSubMenu(manager.getPopup(mockLegendEntry), COLOR_SUBMENU);
   
    Assert.assertEquals(menu.getComponentCount(), PlotConstants.MAX_NUMBER_OF_DATA_ITEMS_ON_A_PLOT);   
  }
View Full Code Here

  @Test
  public void testLegendEntryRegressionMenu() {
    Mockito.when(mockPolicyManager.execute(Mockito.anyString(), Mockito.<PolicyContext> any()))
      .thenReturn(new ExecutionResult(null, false, null))
   
    LegendEntryPopupMenuFactory manager = new LegendEntryPopupMenuFactory(mockPlotViewManifestation);
    JMenuItem regressionLineCheckbox = ((JMenuItem) manager.getPopup(mockLegendEntry).getComponent(PREDICTION_CHECKBOX));
    Assert.assertEquals(regressionLineCheckbox.getText(), BUNDLE.getString("RegressionLineLabel"));
    Assert.assertFalse(regressionLineCheckbox.isSelected());
    JMenu regressionPointsMenu = ((JMenu) manager.getPopup(mockLegendEntry).getComponent(PREDICTION_SUBMENU));   
    Assert.assertEquals(regressionPointsMenu.getText(), BUNDLE.getString("RegressionPointsLabel"))
    JSpinner regressionPointsSpinner = (JSpinner) regressionPointsMenu.getMenuComponent(0);
    Assert.assertEquals(regressionPointsSpinner.getModel().getValue(), mockLegendEntry.getNumberRegressionPoints());
  }
View Full Code Here

  @Test
  public void testLegendEntryPopupMenuColors() {
    Mockito.when(mockPolicyManager.execute(Mockito.anyString(), Mockito.<PolicyContext> any()))
    .thenReturn(new ExecutionResult(null, false, null))
 
    LegendEntryPopupMenuFactory manager = new LegendEntryPopupMenuFactory(mockPlotViewManifestation);
    JPopupMenu menu = getSubMenu(manager.getPopup(mockLegendEntry), COLOR_SUBMENU);
   
    /* Draw icons to this to test for color correctness */
    BufferedImage image = new BufferedImage(12, 12, BufferedImage.TYPE_INT_RGB);
    Graphics      graphics = image.getGraphics();
   
View Full Code Here

  @Test
  public void testLegendEntryPopupMenuSelection() {
    Mockito.when(mockPolicyManager.execute(Mockito.anyString(), Mockito.<PolicyContext> any()))
    .thenReturn(new ExecutionResult(null, false, null))
 
    LegendEntryPopupMenuFactory manager = new LegendEntryPopupMenuFactory(mockPlotViewManifestation);
    for (int i = 0; i < PlotConstants.MAX_NUMBER_OF_DATA_ITEMS_ON_A_PLOT; i++) {
      Mockito.when(mockLegendEntry.getForeground()).thenReturn(PlotLineColorPalette.getColor(i));
 
      JPopupMenu menu = getSubMenu(manager.getPopup(mockLegendEntry), COLOR_SUBMENU);
     
      JRadioButtonMenuItem  item = (JRadioButtonMenuItem) menu.getComponent(i);
      Assert.assertTrue(item.isSelected());
      for (int j = 0; j < PlotConstants.MAX_NUMBER_OF_DATA_ITEMS_ON_A_PLOT; j++) {
        if (j != i) {
View Full Code Here

  @Test
  public void testLegendEntryPopupMenuThicknesses() {
    Mockito.when(mockPolicyManager.execute(Mockito.anyString(), Mockito.<PolicyContext> any()))
    .thenReturn(new ExecutionResult(null, false, null))
 
    LegendEntryPopupMenuFactory manager = new LegendEntryPopupMenuFactory(mockPlotViewManifestation);
    JPopupMenu menu = getSubMenu(manager.getPopup(mockLegendEntry), THICKNESS_SUBMENU );
   
    Assert.assertEquals(menu.getComponentCount(), PlotConstants.MAX_LINE_THICKNESS);
   
    for (int i = 1; i < PlotConstants.MAX_LINE_THICKNESS; i++) {
      JMenuItem item = (JMenuItem) menu.getComponent(i - 1);
View Full Code Here

  @Test
  public void testLegendEntryPopupMenuThicknessSelection() {
    Mockito.when(mockPolicyManager.execute(Mockito.anyString(), Mockito.<PolicyContext> any()))
    .thenReturn(new ExecutionResult(null, false, null))
 
    LegendEntryPopupMenuFactory manager = new LegendEntryPopupMenuFactory(mockPlotViewManifestation);
    for (int i = 0; i < PlotConstants.MAX_LINE_THICKNESS; i++) {
      LineSettings settings = new LineSettings();
      settings.setThickness(i + 1);
      Mockito.when(mockLegendEntry.getLineSettings()).thenReturn(settings);
 
      JPopupMenu menu = getSubMenu(manager.getPopup(mockLegendEntry), THICKNESS_SUBMENU );
     
      JRadioButtonMenuItem  item = (JRadioButtonMenuItem) menu.getComponent(i);
      Assert.assertTrue(item.isSelected());
      for (int j = 0; j < PlotConstants.MAX_LINE_THICKNESS; j++) {
        if (j != i) {
View Full Code Here

TOP

Related Classes of gov.nasa.arc.mct.fastplot.view.LegendEntryPopupMenuFactory$LegendEntryPopup

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.