Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright (c) 2008, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code 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
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.scenario;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
import com.sun.javafx.tk.Toolkit;
import javafx.util.Callback;
/**
* A simple class to store and retrieve internal Scenario settings in the form
* of String key/value pairs. It is meant to be used in a similar way to System
* Properties, but without the security restrictions. This class is designed
* primarily to aid in testing and benchmarking Scenario itself.
*
* If you are running in an environment that allows System Property access, this
* class will attempt to look for a key's value in the System Properties if none
* is found in Settings. This allows Settings to be set on the command line as
* well as via the Settings API.
*
*/
public class Settings {
private final Map settings = new HashMap<>(5);
private final CopyOnWriteArrayList> listeners = new CopyOnWriteArrayList<>();
private static final Object SETTINGS_KEY;
static {
SETTINGS_KEY = new StringBuilder("SettingsKey");
// It seems no longer necessary to force loading of PrimaryTimer to pick
// up the hi-res timer workaround. Also, this is causing some init
// order problems (RT-5572), so it's being commented out.
// Object obj = ToolkitAccessor.getPrimaryTimer();
}
private static synchronized Settings getInstance() {
Map