Search in sources :

Example 6 with Log

use of com.google.android.exoplayer2.util.Log in project DistributedFractalNetwork by Budder21.

the class ClientTest method main.

public static void main(String[] args) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException, IOException {
    System.out.println("client test");
    Layer.initializeFractalRegistry();
    Log log = new Log();
    log.setPrintStream(System.out);
    log.setLogLevel(Log.LEVEL_LOG);
    log.setPrintLevel(Log.LEVEL_LOG);
    Client c = new Client();
    System.out.println("display");
    String ip = JOptionPane.showInputDialog("IP Address");
    Thread t = null;
    t = new Thread(() -> {
        JFrame f = new JFrame();
        JTextArea text = new JTextArea(20, 25);
        JScrollPane scroll = new JScrollPane(text);
        DefaultCaret caret = (DefaultCaret) text.getCaret();
        caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);
        scroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
        scroll.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
        f.setContentPane(scroll);
        f.pack();
        f.setLocationRelativeTo(null);
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setVisible(true);
        while (true) {
            text.setText(log.getLog());
            try {
                t.sleep(2000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    });
    t.start();
    c.init(log, ip);
}
Also used : JScrollPane(javax.swing.JScrollPane) JTextArea(javax.swing.JTextArea) DefaultCaret(javax.swing.text.DefaultCaret) Log(util.Log) JFrame(javax.swing.JFrame)

Aggregations

Metadata (com.google.android.exoplayer2.metadata.Metadata)3 TrackGroup (com.google.android.exoplayer2.source.TrackGroup)2 TrackGroupArray (com.google.android.exoplayer2.source.TrackGroupArray)2 MappedTrackInfo (com.google.android.exoplayer2.trackselection.MappingTrackSelector.MappedTrackInfo)2 TrackSelection (com.google.android.exoplayer2.trackselection.TrackSelection)2 Log (util.Log)2 ExoPlayerVideoDisplayComponent (com.brightcove.player.display.ExoPlayerVideoDisplayComponent)1 Event (com.brightcove.player.event.Event)1 EventListener (com.brightcove.player.event.EventListener)1 Video (com.brightcove.player.model.Video)1 RendererCapabilities (com.google.android.exoplayer2.RendererCapabilities)1 Capabilities (com.google.android.exoplayer2.RendererCapabilities.Capabilities)1 Id3Frame (com.google.android.exoplayer2.metadata.id3.Id3Frame)1 Util.getFormatSupportString (com.google.android.exoplayer2.util.Util.getFormatSupportString)1 Layer (fractal.Layer)1 Palette (fractal.Palette)1 RenderManager (fractal.RenderManager)1 AWTException (java.awt.AWTException)1 Dimension (java.awt.Dimension)1 Toolkit (java.awt.Toolkit)1