<commit_before>/*******************************************************************************
 * Copyright (c) 2017 <NAME> and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the 2-clause BSD License 
 * which accompanies this distribution, and is available at
 * https://opensource.org/licenses/BSD-2-Clause
 *
 * Contributors:
 *     <NAME> and others - initial API and implementation
 *******************************************************************************/
package com.net2plan.gui.plugins.networkDesign.viewEditTopolTables.monitoring;


import com.net2plan.gui.plugins.GUINetworkDesign;
import com.net2plan.gui.plugins.GUINetworkDesignConstants;
import com.net2plan.gui.plugins.networkDesign.visualizationControl.PickManager;
import com.net2plan.gui.utils.NetworkElementOrFr;
import com.net2plan.interfaces.networkDesign.*;
import com.net2plan.internal.Constants;
import com.net2plan.internal.CustomHTMLEditorKit;
import com.net2plan.libraries.TrafficPredictor;
import com.net2plan.utils.Pair;
import net.miginfocom.swing.MigLayout;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.StandardChartTheme;
import org.jfree.chart.axis.DateAxis;
import org.jfree.chart.plot.*;
import org.jfree.chart.renderer.xy.XYItemRenderer;
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer;
import org.jfree.chart.ui.RectangleAnchor;
import org.jfree.chart.ui.TextAnchor;
import org.jfree.data.time.FixedMillisecond;
import org.jfree.data.time.TimeSeries;
import org.jfree.data.time.TimeSeriesCollection;

import javax.swing.*;
import javax.swing.text.Document;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.SimpleDateFormat;
import java.util.List;
import java.util.*;
import java.util.Map.Entry;
import java.util.function.Function;

public class MonitoringGraphPane extends JPanel
{
	private static final long serialVersionUID = 15555L;
	private final GUINetworkDesign callback;

	public MonitoringGraphPane(GUINetworkDesign callback)
	{
		super();

		this.callback = callback;

		this.setVisible(true);
		this.setLayout(new MigLayout("insets 0, fill, wrap 1"));
		this.setBackground(Color.WHITE);

		StandardChartTheme theme = (StandardChartTheme) StandardChartTheme.createJFreeTheme();
		theme.setPlotBackgroundPaint(GUINetworkDesignConstants.YELLOW_BRANCH_COLOR);
		theme.setDomainGridlinePaint(Color.LIGHT_GRAY);
		theme.setRangeGridlinePaint(Color.LIGHT_GRAY);
		theme.setExtraLargeFont(this.getFont().deriveFont(Font.BOLD, 20));
		theme.setLargeFont(this.getFont().deriveFont(Font.PLAIN, 18));
		theme.setRegularFont(this.getFont().deriveFont(Font.PLAIN, 12));
		theme.setSmallFont(this.getFont().deriveFont(Font.PLAIN, 10));

		Paint[] paintSequence = DefaultDrawingSupplier.DEFAULT_PAINT_SEQUENCE;
		Shape[] shapes = DefaultDrawingSupplier.DEFAULT_SHAPE_SEQUENCE;
		if(paintSequence.length > 3 && shapes.length > 3)
		{
			paintSequence[0] = GUINetworkDesignConstants.YELLOW_BRANCH_COLOR;
			paintSequence[1] = Color.DARK_GRAY;
			paintSequence[2] = Color.GREEN;<commit_msg>Solved color issues<commit_after>/*******************************************************************************
 * Copyright (c) 2017 <NAME> and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the 2-clause BSD License 
 * which accompanies this distribution, and is available at
 * https://opensource.org/licenses/BSD-2-Clause
 *
 * Contributors:
 *     <NAME> and others - initial API and implementation
 *******************************************************************************/
package com.net2plan.gui.plugins.networkDesign.viewEditTopolTables.monitoring;


import com.net2plan.gui.plugins.GUINetworkDesign;
import com.net2plan.gui.plugins.GUINetworkDesignConstants;
import com.net2plan.gui.plugins.networkDesign.visualizationControl.PickManager;
import com.net2plan.gui.utils.NetworkElementOrFr;
import com.net2plan.interfaces.networkDesign.*;
import com.net2plan.internal.Constants;
import com.net2plan.internal.CustomHTMLEditorKit;
import com.net2plan.libraries.TrafficPredictor;
import com.net2plan.utils.Pair;
import net.miginfocom.swing.MigLayout;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.StandardChartTheme;
import org.jfree.chart.axis.DateAxis;
import org.jfree.chart.plot.*;
import org.jfree.chart.renderer.xy.XYItemRenderer;
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer;
import org.jfree.chart.ui.RectangleAnchor;
import org.jfree.chart.ui.TextAnchor;
import org.jfree.data.time.FixedMillisecond;
import org.jfree.data.time.TimeSeries;
import org.jfree.data.time.TimeSeriesCollection;

import javax.swing.*;
import javax.swing.text.Document;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.SimpleDateFormat;
import java.util.List;
import java.util.*;
import java.util.Map.Entry;
import java.util.function.Function;

public class MonitoringGraphPane extends JPanel
{
	private static final long serialVersionUID = 15555L;
	private final GUINetworkDesign callback;

	public MonitoringGraphPane(GUINetworkDesign callback)
	{
		super();

		this.callback = callback;

		this.setVisible(true);
		this.setLayout(new MigLayout("insets 0, fill, wrap 1"));
		this.setBackground(Color.WHITE);

		StandardChartTheme theme = (StandardChartTheme) StandardChartTheme.createJFreeTheme();
		theme.setPlotBackgroundPaint(Color.WHITE);
		theme.setDomainGridlinePaint(Color.LIGHT_GRAY);
		theme.setRangeGridlinePaint(Color.LIGHT_GRAY);
		theme.setExtraLargeFont(this.getFont().deriveFont(Font.BOLD, 20));
		theme.setLargeFont(this.getFont().deriveFont(Font.PLAIN, 18));
		theme.setRegularFont(this.getFont().deriveFont(Font.PLAIN, 12));
		theme.setSmallFont(this.getFont().deriveFont(Font.PLAIN, 10));

		Paint[] paintSequence = DefaultDrawingSupplier.DEFAULT_PAINT_SEQUENCE;
		Shape[] shapes = DefaultDrawingSupplier.DEFAULT_SHAPE_SEQUENCE;
		if(paintSequence.length > 3 && shapes.length > 3)
		{
			paintSequence[0] = Color.BLUE;
			paintSequence[1] = Color.DARK_GRAY;
			paintSequence[2] = Color.GREEN;
{'fraction_non_alphanumeric': 0.15270547404953463, 'fraction_numerical': 0.011358258400378608, 'mean_word_length': 6.329479768786127, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4746701', 'n_tokens_mistral': 2043, 'n_tokens_neox': 1918, 'n_words': 345}