package com.sometrik.framework;

import java.io.ByteArrayInputStream;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.view.View;
import android.widget.ImageView;

public class FWImageView extends ImageView implements NativeCommandHandler {

  FrameWork frame;
  
  public FWImageView(FrameWork frame) {
    super(frame);
    
  }

  @Override
  public void onScreenOrientationChange(boolean isLandscape) {
    // TODO Auto-generated method stub
    
  }

  @Override
  public void addChild(View view) {
    // TODO Auto-generated method stub
    
  }

  @Override
  public void addOption(int optionId, String text) {
    // TODO Auto-generated method stub
    
  }

  @Override
  public void addColumn(String text, int columnType) {
    // TODO Auto-generated method stub
    
  }

  @Override
  public void addData(String text, int row, int column, int sheet) {
    // TODO Auto-generated method stub
    
  }

  @Override
  public void setValue(String v) {
    
  }

  @Override
  public void setValue(int v) {
    // TODO Auto-generated method stub
    
  }

  @Override
  public void reshape(int value, int size) {
    // TODO Auto-generated method stub
    
  }

  @Override
  public void setViewEnabled(Boolean enabled) {
    // TODO Auto-generated method stub
    
  }

  @Override
  public void setViewVisibility(boolean visible) {
    // TODO Auto-generated method stub
    
  }

  @Override
  public void setStyle(String key, String value) {
    // TODO Auto-generated method stub
    
  }

  @Override
  public void setError(boolean hasError, String errorText) {
    // TODO Auto-generated method stub
    
  }

  @Override
  public void clear() {
    // TODO Auto-generated method stub
    
  }

  @Override
  public void flush() {
    // TODO Auto-generated method stub
    
  }

  @Override
  public int getElementId() {
    return getId();
  }

  @Override
  public void setImage(byte[] bytes) {
    this.setImage(bytes);
  }

  @Override
  public void reshape(int size) {
    // TODO Auto-generated method stub
    
  }

}

@@ -37,38 +37,25 @@
 ort 
-java.io.ByteArrayInputStream;%0A
+android.util.Log;
 %0Aimp
@@ -66,31 +66,28 @@
 android.
-graphics.Bitmap
+view.Gravity
 ;%0Aimport
@@ -99,30 +99,17 @@
 oid.
-graphics.BitmapFactory
+view.View
 ;%0Aim
@@ -113,37 +113,44 @@
 %0Aimport android.
-view.
+widget.Image
 View;%0Aimport and
@@ -161,25 +161,77 @@
 .widget.
-ImageView
+LinearLayout;%0Aimport android.widget.LinearLayout.LayoutParams
 ;%0A%0Apubli
@@ -383,24 +383,203 @@
 frame);%0A    
+LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);%0A    this.setLayoutParams(params);
 %0A  %7D%0A%0A  @Ove
@@ -1701,47 +1701,1350 @@
     
-// TODO Auto-generated method stub%0A    
+if (key.equals(%22gravity%22)) %7B%0A      LinearLayout.LayoutParams params = (LayoutParams) getLayoutParams();%0A      if (value.equals(%22bottom%22)) %7B%0A%09params.gravity = Gravity.BOTTOM;%0A      %7D else if (value.equals(%22top%22)) %7B%0A%09params.gravity = Gravity.TOP;%0A      %7D else if (value.equals(%22left%22)) %7B%0A%09params.gravity = Gravity.LEFT;%0A      %7D else if (value.equals(%22right%22)) %7B%0A%09params.gravity = Gravity.RIGHT;%0A      %7D%0A      setLayoutParams(params);%0A    %7D else if (key.equals(%22width%22)) %7B%0A      LinearLayout.LayoutParams params = (LayoutParams) getLayoutParams();%0A      if (value.equals(%22wrap-content%22)) %7B%0A%09params.width = LinearLayout.LayoutParams.WRAP_CONTENT;%0A      %7D else if (value.equals(%22match-parent%22)) %7B%0A%09params.width = LinearLayout.LayoutParams.MATCH_PARENT;%0A      %7D%0A      setLayoutParams(params);%0A    %7D else if (key.equals(%22height%22)) %7B%0A      LinearLayout.LayoutParams params = (LayoutParams) getLayoutParams();%0A      if (value.equals(%22wrap-content%22)) %7B%0A%09params.height = LinearLayout.LayoutParams.WRAP_CONTENT;%0A      %7D else if (value.equals(%22match-parent%22)) %7B%0A%09params.height = LinearLayout.LayoutParams.MATCH_PARENT;%0A      %7D%0A      setLayoutParams(params);%0A    %7D else if (key.equals(%22weight%22)) %7B%0A      LinearLayout.LayoutParams params = (LayoutParams) getLayoutParams();%0A      params.weight = Integer.parseInt(value);%0A      setLayoutParams(params);%0A    %7D
 %0A  %7D

Add style options for FWImageView