<commit_before>/*
 * ################################################################
 *
 * ProActive: The Java(TM) library for Parallel, Distributed,
 *            Concurrent computing with Security and Mobility
 *
 * Copyright (C) 1997-2007 INRIA/University of Nice-Sophia Antipolis
 * Contact: <EMAIL>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version
 * 2 of the License, or any later version.
 *
 * This library 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
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 * USA
 *
 *  Initial developer(s):               The ProActive Team
 *                        http://proactive.inria.fr/team_members.htm
 *  Contributor(s):
 *
 * ################################################################
 */
package org.objectweb.proactive.ic2d.jmxmonitoring.figure;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;

import org.eclipse.draw2d.BorderLayout;
import org.eclipse.draw2d.Connection;
import org.eclipse.draw2d.ConnectionAnchor;
import org.eclipse.draw2d.Figure;
import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.LayoutManager;
import org.eclipse.draw2d.MouseListener;
import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Device;
import org.eclipse.swt.widgets.Display;
import org.objectweb.proactive.ic2d.jmxmonitoring.data.State;


public class AOFigure extends AbstractFigure {
    protected final static int DEFAULT_WIDTH = 40;
    private static final Color DEFAULT_BORDER_COLOR;

    // States
    public static final Color COLOR_WHEN_WAITING_FOR_REQUEST;
    public static final Color COLOR_WHEN_WAITING_BY_NECESSITY;
    public static final Color COLOR_WHEN_ACTIVE;
    public static final Color COLOR_WHEN_SERVING_REQUEST;
    public static final Color COLOR_WHEN_MIGRATING;
    public static final Color COLOR_WHEN_NOT_RESPONDING;

    // Request Queue length
    public static final int NUMBER_OF_REQUESTS_FOR_SEVERAL = 5;
    public static final int NUMBER_OF_REQUESTS_FOR_MANY = 50;
    public static final Color COLOR_REQUEST_SINGLE;
    public static final Color COLOR_REQUEST_SEVERAL;
    public static final Color COLOR_REQUEST_MANY;
    public static final int REQUEST_FIGURE_SIZE = 4;
    public static final Display device;

    static {
        device = Display.getCurrent();
        COLOR_WHEN_WAITING_FOR_REQUEST = new Color(device, 225, 225, 225);
        COLOR_WHEN_WAITING_BY_NECESSITY = new Color(device, 255, 205, 110);
        COLOR_WHEN_ACTIVE = new Color(device, 180, 255, 180); // green
        COLOR_WHEN_SERVING_REQUEST = new Color(device, 255, 255, 255); //white
        COLOR_WHEN_MIGRATING = new Color(device, 0, 0, 255); // blue
        COLOR_WHEN_NOT_RESPONDING = new Color(device, 255, 0, 0); // red

        DEFAULT_BORDER_COLOR = new Color(device, 200, 200, 200);

        COLOR_REQUEST_SINGLE = new Color(device, 0, 255, 0); // green
        COLOR_REQUEST_SEVERAL = new Color(device, 255, 0, 0); // red
        COLOR_REQUEST_MANY = new Color(device, 150, 0, 255); // violet
    }

    /** Request queue length (used to display small square int the active object) */
    private int requestQueueLength;

    /** if the active object has a security manager or not */
    private boolean isSecure = false;<commit_msg>IC2D JMXMonitoring plugin : Modification of the color of ServingRequest State is now in blue was white. Migration is in violet was in blue<commit_after>/*
 * ################################################################
 *
 * ProActive: The Java(TM) library for Parallel, Distributed,
 *            Concurrent computing with Security and Mobility
 *
 * Copyright (C) 1997-2007 INRIA/University of Nice-Sophia Antipolis
 * Contact: <EMAIL>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version
 * 2 of the License, or any later version.
 *
 * This library 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
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 * USA
 *
 *  Initial developer(s):               The ProActive Team
 *                        http://proactive.inria.fr/team_members.htm
 *  Contributor(s):
 *
 * ################################################################
 */
package org.objectweb.proactive.ic2d.jmxmonitoring.figure;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;

import org.eclipse.draw2d.BorderLayout;
import org.eclipse.draw2d.Connection;
import org.eclipse.draw2d.ConnectionAnchor;
import org.eclipse.draw2d.Figure;
import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.LayoutManager;
import org.eclipse.draw2d.MouseListener;
import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Device;
import org.eclipse.swt.widgets.Display;
import org.objectweb.proactive.ic2d.jmxmonitoring.data.State;


public class AOFigure extends AbstractFigure {
    protected final static int DEFAULT_WIDTH = 40;
    private static final Color DEFAULT_BORDER_COLOR;

    // States
    public static final Color COLOR_WHEN_WAITING_FOR_REQUEST;
    public static final Color COLOR_WHEN_WAITING_BY_NECESSITY;
    public static final Color COLOR_WHEN_ACTIVE;
    public static final Color COLOR_WHEN_SERVING_REQUEST;
    public static final Color COLOR_WHEN_MIGRATING;
    public static final Color COLOR_WHEN_NOT_RESPONDING;

    // Request Queue length
    public static final int NUMBER_OF_REQUESTS_FOR_SEVERAL = 5;
    public static final int NUMBER_OF_REQUESTS_FOR_MANY = 50;
    public static final Color COLOR_REQUEST_SINGLE;
    public static final Color COLOR_REQUEST_SEVERAL;
    public static final Color COLOR_REQUEST_MANY;
    public static final int REQUEST_FIGURE_SIZE = 4;
    public static final Display device;

    static {
        device = Display.getCurrent();
        COLOR_WHEN_WAITING_FOR_REQUEST = new Color(device, 225, 225, 225);
        COLOR_WHEN_WAITING_BY_NECESSITY = new Color(device, 255, 205, 110);
        COLOR_WHEN_ACTIVE = new Color(device, 180, 255, 180); // green
        COLOR_WHEN_SERVING_REQUEST = new Color(device, 0, 0, 255); // blue was white: new Color(device, 255, 255, 255);
        COLOR_WHEN_MIGRATING = new Color(device, 150, 0, 255); // violet was blue: new Color(device, 0, 0, 255);
        COLOR_WHEN_NOT_RESPONDING = new Color(device, 255, 0, 0); // red

        DEFAULT_BORDER_COLOR = new Color(device, 200, 200, 200);

        COLOR_REQUEST_SINGLE = new Color(device, 0, 255, 0); // green
        COLOR_REQUEST_SEVERAL = new Color(device, 255, 0, 0); // red
        COLOR_REQUEST_MANY = new Color(device, 150, 0, 255); // violet
    }

    /** Request queue length (used to display small square int the active object) */
    private int requestQueueLength;

    /** if the active object has a security manager or not */
    private boolean isSecure = false;
{'fraction_non_alphanumeric': 0.10679133858267717, 'fraction_numerical': 0.029404527559055118, 'mean_word_length': 3.896987951807229, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, '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': '383169', 'n_tokens_mistral': 2602, 'n_tokens_neox': 2321, 'n_words': 773}