Aktualisierungen April, 2017 Kommentarverlauf ein-/ausschalten | Tastaturkürzel

  • Andreas Höhmann 7:52 am Tuesday, 25. April 2017 Permalink |  

    Repair Eclipse Workbench UI :) 

    Sometime (after a Eclipse crash) I have this annoying multiple Mylyn Task-Selection-Control in the Trimbar…

    eclipse_trimbar_multiple_mylyn.png

    (mehr …)

     
  • Andreas Höhmann 22:02 am Tuesday, 18. October 2016 Permalink |
    Tags: Battlefield4   

    Light machine gun #1 in Leipzig it’s … *tata* … me baby 🙂

    battlenet

     
    • literateaspects 23:52 am Sonntag, 26. März 2017 Permalink | Zum Antworten anmelden

      Hello, I responding to a Vaadin post you made a while ago.

      „Currently I’m using Spring Tools Suite + Maven + JRebel … and it’s so easy to develop a Vaadin app … I love it emoticon“

      I am a basic JSF web app developer and am following the exact same footsteps are you are into Spring and Vaadin.

      Currently, I am hoping to discover how to connect my JSF remote data to Vaadin Grid. Any suggestions greatly appreciated:

      https://vaadin.com/forum#!/thread/15513370/15513369

      Thank you.

      • Andreas Höhmann 13:39 am Montag, 27. März 2017 Permalink | Zum Antworten anmelden

        Hi, oh dear this is very old stuff 🙂 Currently I don’t use STS directly anymore and JSF is totally out of scope in my daily work 🙂 But I think if you want use Vaadin Grid in JSF directly you can given Vaadin 8 with „web-components“ a try or if you have a real Vaadin App running .. extract the „old jsf data“ code and provide a „service implementation“ in your app for that.

  • Andreas Höhmann 12:56 am Saturday, 12. September 2015 Permalink |  

    11.09.2015 – 12,0 km – 01:17:00 

    laufen_11_09_2015_12_km

    Google Maps

     
  • Andreas Höhmann 22:41 am Thursday, 27. August 2015 Permalink |  

    27.08.2015 – 9,0 km – 00:58:00 

    laufen_27_08_2015_9_km

    Google Maps

     
  • Andreas Höhmann 21:28 am Sunday, 23. August 2015 Permalink |  

    23.08.2015 – 11,0 km – 01:10:00 

    laufen_23_08_2015__11_km

    Google Maps

    Aktueller Stand August: 105,87 km

    Ab morgen beginnt wieder das reguläre Karate Training 🙂 Mal sehen wie oft ich dann noch laufen gehe 😉

     
  • Andreas Höhmann 13:48 am Wednesday, 14. March 2012 Permalink |
    Tags: ehcache, , jmx   

    Enable JMX Management for Hibernate EhCache 

    Have a look at

    • net.sf.ehcache.hibernate.SingletonEhCacheRegionFactory.start(Settings, Properties)
    • net.sf.ehcache.hibernate.management.impl.ProviderMBeanRegistrationHelper.registerMBean(CacheManager, Properties)
    What we need is a system property „tc.active“ with value „true“
    🙂
     
  • Andreas Höhmann 0:29 am Friday, 7. October 2011 Permalink |  

    RIP Steve Jobs 

    Steve Jobs 1955 – 2011

     
  • Andreas Höhmann 19:16 am Sunday, 18. September 2011 Permalink |  

    Gregor Gysi macht die Merkel zur Schnecke 

     

     
  • Andreas Höhmann 1:32 am Thursday, 24. March 2011 Permalink |  

    Bloxel with simple mining prototype 

    Last weeks I tried to make a better way to describe how a piece of our bloxel world is filled with content.

    Why … because bloxel have some memory problems with completely filled chunks (hills, underground) … so there was only a surface … no mining was possible  🙂

    In my first version all TerrainElement’s in a chunk stored with a simple ArrayList. So the TerrainLoader (height map based) initialize a chunk with some elements to build a surface. There is no underground information. I tried to fix this by creating ALL elements under the surface and storing them in the chunk … but then the memory usage was very high and the rendering very slow (actually we have no good culling implemented). I guess there is a better solution to describe the elements in a chunk. I tried the Octree.

    Imagine a 8x8x8 chunk filled with 8x8x7 dirt (underground) and 8x8x1 grass (surface). Then the chunk has 512 bloxels, most of them are the same material : dirt … so it’s better to merge same 1x1x1 bloxels into a bigger bloxel.

    Now I’m using a Octree to pack same elements for a chunk. This reduce memory and It’s faster to get the type of x,y,z bloxel from a chunk. After a change on the chunk (add or remove bloxels) the Octree needs an update.

    In the next blog I will go deeper into the technical details … for now 2 new screenshots … with a lot of sand under the surface 😀

     
  • Andreas Höhmann 12:26 am Wednesday, 19. May 2010 Permalink |
    Tags: concurrent, Executors, progressbar, splashscreen   

    Progress splash screen in java with simulate mode 

    Today I will share a little piece of code … a splash screen with a progress bar feature.

    The splash screen support three modes:

    • Indeterminate – animated percentage of completion
    • Determinate – defined percentage of completion
    • Determinate + Simulation – define a FROM and TO percentage and the progress bar will run automatically  (done with the  autoProgressExecutor)
    
    package de.ahoehma;
    
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.image.BufferedImage;
    import java.io.IOException;
    import java.io.InputStream;
    import java.util.concurrent.ExecutorService;
    import java.util.concurrent.Executors;
    import java.util.concurrent.TimeUnit;
    
    import javax.imageio.ImageIO;
    import javax.swing.BorderFactory;
    import javax.swing.ImageIcon;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JProgressBar;
    import javax.swing.JWindow;
    import javax.swing.SwingConstants;
    import javax.swing.border.BevelBorder;
    
    class ProgressSplashScreen extends JWindow {
    
       private static final long serialVersionUID = 935801891530361293L;
       private static final Color COLOR_PROGRESS_BACKGROUND = new Color(160, 182, 192);
       private static final Color COLOR_PROGRESS_FORGROUND = new Color(215, 224, 227);
       private final BufferedImage splashScreenImage;
       private final JProgressBar progressbar;
       private final ExecutorService autoProgressExecutor = Executors.newFixedThreadPool(1);
    
       public ProgressSplashScreen(final InputStream theResourceAsStream) {
         this(theResourceAsStream, -1, -1);
       }
    
       public ProgressSplashScreen(final InputStream theResourceAsStream,
                                 final int theMin, final int theMax) {
         super();
         try {
           splashScreenImage = ImageIO.read(theResourceAsStream);
         } catch (final IOException e) {
           throw new IllegalArgumentException(String.format("Can't load splashscreen"), e);
         }
         final JPanel contentPanel = new JPanel(new BorderLayout());
         contentPanel.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED));
         if (theMin != -1 && theMax != -1) {
           progressbar = new JProgressBar(SwingConstants.HORIZONTAL, theMin, theMax);
         } else {
           progressbar = new JProgressBar(SwingConstants.HORIZONTAL);
           progressbar.setIndeterminate(true);
         }
         progressbar.setBackground(COLOR_PROGRESS_BACKGROUND);
         progressbar.setForeground(COLOR_PROGRESS_FORGROUND);
         progressbar.setStringPainted(true);
         final JLabel label = new JLabel(new ImageIcon(splashScreenImage));
         contentPanel.add(label, BorderLayout.CENTER);
         contentPanel.add(progressbar, BorderLayout.SOUTH);
         add(contentPanel);
         pack();
         setLocationRelativeTo(null);
         setAlwaysOnTop(true);
       }
    
       public void close() {
         setVisible(false);
        autoProgressExecutor.shutdownNow();
        dispose();
       }
    
       public void showProgress(final int theValue) {
         setVisible(true);
         progressbar.setValue(theValue);
         if (progressbar.getValue() == 100) {
           setVisible(false);
         }
       }
    
       public void showProgress(final int theValueTo, final int theEstimatedTimeInSeconds) {
         showProgress(progressbar.getValue(), theValueTo, theEstimatedTimeInSeconds);
       }
    
       public void showProgress(final int theValueFrom, final int theValueTo,
                                     final int theEstimatedTimeInSeconds) {
         setVisible(true);
         autoProgressExecutor.execute(new Runnable() {
             public void run() {
               int numberOfSteps = theValueTo - theValueFrom;
               long timeToWait = TimeUnit.SECONDS.toMillis(theEstimatedTimeInSeconds)
                                        / numberOfSteps;
               for (int i = theValueFrom; i <= theValueTo; i++) {
                   progressbar.setValue(i);
                   try {
                     TimeUnit.MILLISECONDS.sleep(timeToWait);
                   } catch (final InterruptedException e) {
               // ignore
             }
           }
           if (progressbar.getValue() == 100) {
             setVisible(false);
           }
         }
       });
     }
    }
    

    Usage:

    package de.ahoehma;
    
    import java.io.InputStream;
    import java.util.concurrent.TimeUnit;
    
    public class ProgressSplashScreenTest {
    
      public static void main(final String[] args) throws InterruptedException {
    
        final InputStream imageStream = ProgressSplashScreenTest.class.getResourceAsStream("splashscreen.jpg");
        final ProgressSplashScreen splashScreen = new ProgressSplashScreen(imageStream);
        splashScreen.showProgress(25);
        TimeUnit.SECONDS.sleep(2);
        splashScreen.showProgress(50);
        TimeUnit.SECONDS.sleep(2);
        splashScreen.showProgress(75);
        TimeUnit.SECONDS.sleep(2);
        splashScreen.showProgress(100);
        splashScreen.close();
    
        final InputStream imageStream2 = ProgressSplashScreenTest.class.getResourceAsStream("splashscreen.jpg");
        final ProgressSplashScreen splashScreen2 = new ProgressSplashScreen(imageStream2, 1, 100);
        TimeUnit.SECONDS.sleep(2);
        splashScreen2.showProgress(25);
        TimeUnit.SECONDS.sleep(2);
        splashScreen2.showProgress(75);
        TimeUnit.SECONDS.sleep(2);
        splashScreen2.showProgress(100);
        TimeUnit.SECONDS.sleep(2);
        splashScreen2.close();
    
        final InputStream imageStream3 = ProgressSplashScreenTest.class.getResourceAsStream("splashscreen.jpg");
        final ProgressSplashScreen splashScreen3 = new ProgressSplashScreen(imageStream3);
        splashScreen3.showProgress(25, 1);
        TimeUnit.SECONDS.sleep(1);
        splashScreen3.showProgress(25, 75, 2);
        TimeUnit.SECONDS.sleep(2);
        splashScreen3.showProgress(90, 2);
        TimeUnit.SECONDS.sleep(2);
        splashScreen3.showProgress(100, 2);
        TimeUnit.SECONDS.sleep(2);
        splashScreen3.close();
    
        final InputStream imageStream4 = ProgressSplashScreenTest.class.getResourceAsStream("splashscreen.jpg");
        final ProgressSplashScreen splashScreen4 = new ProgressSplashScreen(imageStream4, 1, 100);
        splashScreen4.showProgress(25, 1);
        TimeUnit.SECONDS.sleep(1);
        splashScreen4.showProgress(25, 75, 2);
        TimeUnit.SECONDS.sleep(2);
        splashScreen4.showProgress(90, 2);
        TimeUnit.SECONDS.sleep(2);
        splashScreen4.showProgress(100, 2);
        TimeUnit.SECONDS.sleep(2);
        splashScreen4.close();
      }
    }
    

    Examples

    😀

     
c
Neuen Beitrag erstellen
j
nächster Beitrag/nächster Kommentar
k
vorheriger Beitrag/vorheriger Kommentar
r
Antworten
e
Bearbeiten
o
zeige/verstecke Kommentare
t
Zum Anfang gehen
l
zum Login
h
Zeige/Verberge Hilfe
Shift + ESC
Abbrechen